Alloc 16 extra bytes in libavfilter frames. Needed for MMX-optimized swscale.
authorVitor Sessak <vitor1001@gmail.com>
Mon, 10 May 2010 00:28:18 +0000 (00:28 +0000)
committerVitor Sessak <vitor1001@gmail.com>
Mon, 10 May 2010 00:28:18 +0000 (00:28 +0000)
Fix issue 1924.

Originally committed as revision 23077 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavfilter/defaults.c

index f348d4f..0ac88f8 100644 (file)
@@ -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));