[FFmpeg-cvslog] avcodec/pngdec: check av_image_get_linesize return value

Benoit Fouet git at videolan.org
Mon Dec 8 05:12:02 CET 2014


ffmpeg | branch: master | Benoit Fouet <benoit.fouet at free.fr> | Mon Dec  8 03:16:46 2014 +0100| [4fa2758c799a4455bd5f69392fdd8aad657e4b50] | committer: Michael Niedermayer

avcodec/pngdec: check av_image_get_linesize return value

Fixes CID 1257012

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4fa2758c799a4455bd5f69392fdd8aad657e4b50
---

 libavcodec/pngdec.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index e6b7593..60acd3f 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",



More information about the ffmpeg-cvslog mailing list