cmdutils: avoid setting data pointers to invalid values in alloc_buffer()
authorAnton Khirnov <anton@khirnov.net>
Tue, 11 Sep 2012 09:03:52 +0000 (11:03 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sat, 15 Sep 2012 12:59:29 +0000 (14:59 +0200)
Fixes bug 352.

cmdutils.c

index 6fb991884fece32a77fd524be3ebeb99e1140c70..0d216db4697517b7466a311e1682dba7866f01aa 100644 (file)
@@ -1316,7 +1316,7 @@ static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbu
         const int v_shift = i==0 ? 0 : v_chroma_shift;
         if (s->flags & CODEC_FLAG_EMU_EDGE)
             buf->data[i] = buf->base[i];
-        else
+        else if (buf->base[i])
             buf->data[i] = buf->base[i] +
                            FFALIGN((buf->linesize[i]*edge >> v_shift) +
                                    (pixel_size*edge >> h_shift), 32);