diff iff.c @ 11699:83b49b0997e8 libavcodec

Ensure that width and height are > 0. avcodec_open() itself only checks that they are >= 0. Patch by Sebastian Vater <cdgs basty googlemail com>.
author rbultje
date Mon, 10 May 2010 17:00:56 +0000
parents 3ec57be57312
children 6bdec2a0e7e1
line wrap: on
line diff
--- a/iff.c	Mon May 10 07:08:57 2010 +0000
+++ b/iff.c	Mon May 10 17:00:56 2010 +0000
@@ -115,6 +115,8 @@
         return AVERROR_INVALIDDATA;
     }
 
+    if ((err = avcodec_check_dimensions(avctx, avctx->width, avctx->height)))
+        return err;
     s->planesize = FFALIGN(avctx->width, 16) >> 3; // Align plane size in bits to word-boundary
     s->planebuf = av_malloc(s->planesize + FF_INPUT_BUFFER_PADDING_SIZE);
     if (!s->planebuf)