Skip to content
Snippets Groups Projects
Commit 5512dbe3 authored by Philip Langdale's avatar Philip Langdale
Browse files

avcodec/crystalhd: Handle errors from av_image_get_linesize

This function can return an error in certain situations.

Fixes Coverity CID 703707.
parent b5c899ab
No related branches found
No related tags found
No related merge requests found
...@@ -568,6 +568,9 @@ static inline CopyRet copy_frame(AVCodecContext *avctx, ...@@ -568,6 +568,9 @@ static inline CopyRet copy_frame(AVCodecContext *avctx,
} }
bwidth = av_image_get_linesize(avctx->pix_fmt, width, 0); bwidth = av_image_get_linesize(avctx->pix_fmt, width, 0);
if (bwidth < 0)
return RET_ERROR;
if (priv->is_70012) { if (priv->is_70012) {
int pStride; int pStride;
...@@ -577,6 +580,8 @@ static inline CopyRet copy_frame(AVCodecContext *avctx, ...@@ -577,6 +580,8 @@ static inline CopyRet copy_frame(AVCodecContext *avctx,
pStride = 1280; pStride = 1280;
else pStride = 1920; else pStride = 1920;
sStride = av_image_get_linesize(avctx->pix_fmt, pStride, 0); sStride = av_image_get_linesize(avctx->pix_fmt, pStride, 0);
if (sStride < 0)
return RET_ERROR;
} else { } else {
sStride = bwidth; sStride = bwidth;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment