diff options
author | Benoit Fouet <benoit.fouet@free.fr> | 2014-12-08 03:16:46 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-12-08 04:58:00 +0100 |
commit | 4fa2758c799a4455bd5f69392fdd8aad657e4b50 (patch) | |
tree | 314a08d74b578f42111d2a7867883cec5bc24714 | |
parent | dceb8b12525c8236ffb389bbd9bf04423a570c1a (diff) | |
download | ffmpeg-4fa2758c799a4455bd5f69392fdd8aad657e4b50.tar.gz |
avcodec/pngdec: check av_image_get_linesize return value
Fixes CID 1257012
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/pngdec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index e6b759322c..60acd3f6a6 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -872,6 +872,9 @@ static int handle_p_frame_apng(AVCodecContext *avctx, PNGDecContext *s, s->previous_picture.f->data[0] : s->last_picture.f->data[0]; int ls = FFMIN(av_image_get_linesize(p->format, s->width, 0), s->width * s->bpp); + if (ls < 0) + return ls; + if (s->blend_op == APNG_BLEND_OP_OVER && avctx->pix_fmt != AV_PIX_FMT_RGBA && avctx->pix_fmt != AV_PIX_FMT_ARGB) { avpriv_request_sample(avctx, "Blending with pixel format %s", |