mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-24 03:59:43 +00:00
avcodec/crystalhd: Handle errors from av_image_get_linesize
This function can return an error in certain situations. Fixes Coverity CID 703707.
This commit is contained in:
parent
b5c899ab5e
commit
5512dbe37f
@ -568,6 +568,9 @@ static inline CopyRet copy_frame(AVCodecContext *avctx,
|
||||
}
|
||||
|
||||
bwidth = av_image_get_linesize(avctx->pix_fmt, width, 0);
|
||||
if (bwidth < 0)
|
||||
return RET_ERROR;
|
||||
|
||||
if (priv->is_70012) {
|
||||
int pStride;
|
||||
|
||||
@ -577,6 +580,8 @@ static inline CopyRet copy_frame(AVCodecContext *avctx,
|
||||
pStride = 1280;
|
||||
else pStride = 1920;
|
||||
sStride = av_image_get_linesize(avctx->pix_fmt, pStride, 0);
|
||||
if (sStride < 0)
|
||||
return RET_ERROR;
|
||||
} else {
|
||||
sStride = bwidth;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user