OSDN Git Service

ffmpeg: Fix image allocation.
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 15 Feb 2012 19:31:57 +0000 (20:31 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 15 Feb 2012 19:35:14 +0000 (20:35 +0100)
This probably fixes some of the use of uninitialized issues valgrind shows in fate.
It might also fix other issues.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg.c

index efe579a..8659ff7 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -510,7 +510,7 @@ static int alloc_buffer(AVCodecContext *s, InputStream *ist, FrameBuffer **pbuf)
     for (i = 0; i < FF_ARRAY_ELEMS(buf->data); i++) {
         const int h_shift = i==0 ? 0 : h_chroma_shift;
         const int v_shift = i==0 ? 0 : v_chroma_shift;
-        if (s->flags & CODEC_FLAG_EMU_EDGE)
+        if ((s->flags & CODEC_FLAG_EMU_EDGE) || !buf->linesize[1])
             buf->data[i] = buf->base[i];
         else
             buf->data[i] = buf->base[i] +