X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcrystalhd.c;h=630d02b6f55c44a83619f9a087f9cd102a111b10;hb=94eb600f354c486fd3a9b50e052e809452673fcf;hp=d85e3518cca0582850b5b9c21df8045309f5d4d9;hpb=190254f8810f8c9c40ce129add652a5120097b3b;p=ffmpeg diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index d85e3518cca..630d02b6f55 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -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; }