From 564ae836fb7bf73cddf39a0cc47108b5f067c126 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 22 Nov 2013 11:00:02 +0100 Subject: [PATCH] avcodec/gifdec: print error if image is not within dimensions Signed-off-by: Michael Niedermayer --- libavcodec/gifdec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index 9305f2e465..a6b6be0470 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -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;