avcodec/gifdec: print error if image is not within dimensions

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/49/head
Michael Niedermayer 11 years ago
parent 8b2578ab45
commit 564ae836fb
  1. 4
      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;

Loading…
Cancel
Save