[FFmpeg-cvslog] avutil/frame: fix video buffer allocation

Michael Niedermayer git at videolan.org
Sun Mar 17 02:25:35 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Mar 17 02:18:08 2013 +0100| [f566ac48ce450b013ffd5547ace48df8c47981c6] | committer: Michael Niedermayer

avutil/frame: fix video buffer allocation

The padding was lost during porting from avcodec
Should fix out of array accesses

Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavutil/frame.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/frame.c b/libavutil/frame.c
index 90f7fce..a5ddab9 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -134,7 +134,7 @@ static int get_video_buffer(AVFrame *frame, int align)
         if (i == 1 || i == 2)
             h = -((-h) >> desc->log2_chroma_h);
 
-        frame->buf[i] = av_buffer_alloc(frame->linesize[i] * h);
+        frame->buf[i] = av_buffer_alloc(frame->linesize[i] * h + 16);
         if (!frame->buf[i])
             goto fail;
 



More information about the ffmpeg-cvslog mailing list