avcodec/gifdec: print error if image is not within dimensions
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 22 Nov 2013 10:00:02 +0000 (11:00 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 22 Nov 2013 10:00:02 +0000 (11:00 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/gifdec.c

index 9305f2e..a6b6be0 100644 (file)
@@ -181,8 +181,10 @@ static int gif_read_image(GifState *s, AVFrame *frame)
 
     /* verify that all the image is inside the screen dimensions */
     if (left + width > s->screen_width ||
-        top + height > s->screen_height)
+        top + height > s->screen_height) {
+        av_log(s->avctx, AV_LOG_ERROR, "image is outside the screen dimensions.\n");
         return AVERROR_INVALIDDATA;
+    }
     if (width <= 0 || height <= 0) {
         av_log(s->avctx, AV_LOG_ERROR, "Invalid image dimensions.\n");
         return AVERROR_INVALIDDATA;