Browse Source

gifdec: check that w,h is not zero

Fixes out of array access

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.2
Michael Niedermayer 13 years ago
parent
commit
286930d302
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/gifdec.c

+ 2
- 0
libavcodec/gifdec.c View File

@@ -187,6 +187,8 @@ static int gif_read_image(GifState *s)
if (left + width > s->screen_width ||
top + height > s->screen_height)
return AVERROR_INVALIDDATA;
if (width <= 0 || height <= 0)
return AVERROR_INVALIDDATA;

/* process disposal method */
if (s->gce_prev_disposal == GCE_DISPOSAL_BACKGROUND) {


Loading…
Cancel
Save