From 8ad802e610771e1e63d6f105739b78b4aa6980d8 Mon Sep 17 00:00:00 2001 From: Vitor Sessak Date: Mon, 10 May 2010 00:28:18 +0000 Subject: [PATCH] Alloc 16 extra bytes in libavfilter frames. Needed for MMX-optimized swscale. Fix issue 1924. Originally committed as revision 23077 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavfilter/defaults.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/defaults.c b/libavfilter/defaults.c index f348d4f2b8..0ac88f85e2 100644 --- a/libavfilter/defaults.c +++ b/libavfilter/defaults.c @@ -55,7 +55,8 @@ AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms, pic->linesize[i] = FFALIGN(pic->linesize[i], 16); tempsize = ff_fill_pointer((AVPicture *)pic, NULL, pic->format, ref->h); - buf = av_malloc(tempsize); + buf = av_malloc(tempsize + 16); // +2 is needed for swscaler, +16 to be + // SIMD-friendly ff_fill_pointer((AVPicture *)pic, buf, pic->format, ref->h); memcpy(ref->data, pic->data, sizeof(pic->data));