aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-25 00:03:59 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-25 03:30:04 +0100
commit286930d302fd34cfc2541bfdd760a8bbf9f2d2e5 (patch)
tree2d45f6fd3ba9dbe7d8e88a1646af68f94ef300ff /libavcodec
parenta0d1440476ced02c17e26947e48ab68a38b36a0e (diff)
downloadffmpeg-286930d302fd34cfc2541bfdd760a8bbf9f2d2e5.tar.gz
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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/gifdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
index 2d9f8b4f3d..d52f2d5348 100644
--- a/libavcodec/gifdec.c
+++ b/libavcodec/gifdec.c
@@ -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) {