[FFmpeg-cvslog] cmdutils: avoid setting data pointers to invalid values in alloc_buffer()

Anton Khirnov git at videolan.org
Sun Sep 16 14:29:18 CEST 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Sep 11 11:03:52 2012 +0200| [990450c5bf17afc31a81d6225afaac86d0dca5dd] | committer: Anton Khirnov

cmdutils: avoid setting data pointers to invalid values in alloc_buffer()

Fixes bug 352.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=990450c5bf17afc31a81d6225afaac86d0dca5dd
---

 cmdutils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmdutils.c b/cmdutils.c
index 6fb9918..0d216db 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -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);



More information about the ffmpeg-cvslog mailing list