Force linesize to be a multiple of 16
authorVitor Sessak <vitor1001@gmail.com>
Fri, 15 Feb 2008 22:00:09 +0000 (22:00 +0000)
committerVitor Sessak <vitor1001@gmail.com>
Fri, 15 Feb 2008 22:00:09 +0000 (22:00 +0000)
Commited in SoC by Vitor Sessak on 2008-02-10 20:51:58

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

libavfilter/defaults.c

index b518d32..5cc60d5 100644 (file)
@@ -46,7 +46,9 @@ AVFilterPicRef *avfilter_default_get_video_buffer(AVFilterLink *link, int perms)
     pic->refcount = 1;
     pic->format   = link->format;
     pic->free     = avfilter_default_free_video_buffer;
-    avpicture_alloc((AVPicture *)pic, pic->format, ref->w, ref->h);
+    avpicture_alloc((AVPicture *)pic, pic->format,
+                    (ref->w + 15) & (~15), // make linesize a multiple of 16
+                    (ref->h + 15) & (~15));
 
     memcpy(ref->data,     pic->data,     sizeof(pic->data));
     memcpy(ref->linesize, pic->linesize, sizeof(pic->linesize));