[FFmpeg-devel] [PATCH]Backport of commit 175e916: avcodec/utils: Fix encoder allocation size

Carl Eugen Hoyos cehoyos at ag.or.at
Tue Jun 11 09:56:31 CEST 2013


Hi!

Attached is the backport of the fix for ticket #2645.

Please review, Carl Eugen
-------------- next part --------------
From 376a9f8e6e362178c4e9d95c7d18e1775c014eb6 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michaelni at gmx.at>
Date: Tue, 11 Jun 2013 00:33:27 +0200
Subject: [PATCH] avcodec/utils: Fix encoder allocation size

Fixes Ticket2645
Found-by: Darrell Walisser
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 175e916fa20b7887bdb29809817985e481ae0888)

Conflicts:
	libavcodec/utils.c
---
 libavcodec/utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 8a4aaf4..2fd61e6 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -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);
 
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list