diff options
author | Philip Langdale <philipl@overt.org> | 2016-11-30 16:03:44 -0800 |
---|---|---|
committer | Philip Langdale <philipl@overt.org> | 2016-11-30 16:14:39 -0800 |
commit | 5512dbe37f83d8b11393c7059c6eae48d164461c (patch) | |
tree | 02006251ef87a3f2554eb30f4e998701f3ad3075 /libavcodec/crystalhd.c | |
parent | b5c899ab5ec8ff89daf4d034f257dd0892625400 (diff) | |
download | ffmpeg-5512dbe37f83d8b11393c7059c6eae48d164461c.tar.gz |
avcodec/crystalhd: Handle errors from av_image_get_linesize
This function can return an error in certain situations.
Fixes Coverity CID 703707.
Diffstat (limited to 'libavcodec/crystalhd.c')
-rw-r--r-- | libavcodec/crystalhd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index d85e3518cc..630d02b6f5 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; } |