avcodec/utils: Fix encoder allocation size
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 10 Jun 2013 22:33:27 +0000 (00:33 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Tue, 11 Jun 2013 07:49:56 +0000 (09:49 +0200)
Fixes Ticket2645
Found-by: Darrell Walisser
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 175e916fa20b7887bdb29809817985e481ae0888)

Conflicts:
libavcodec/utils.c

libavcodec/utils.c

index 8a4aaf4..2fd61e6 100644 (file)
@@ -474,7 +474,7 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
 
             buf->linesize[i] = picture.linesize[i];
 
-            buf->base[i] = av_malloc(size[i] + 16); //FIXME 16
+            buf->base[i] = av_malloc(size[i] + 16 + STRIDE_ALIGN - 1); //FIXME 16
             if (buf->base[i] == NULL)
                 return AVERROR(ENOMEM);