avidemux: fix wrong stride when inverting uncompressed video
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Tue, 8 Nov 2011 15:35:26 +0000 (15:35 +0000)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 9 Nov 2011 11:43:41 +0000 (11:43 +0000)
Such frames have a stride multiple of 4, see
http://lscube.org/pipermail/ffmpeg-issues/2010-April/010247.html.

This showed up on a sample using a odd width of 24 bit video.

https://bugzilla.gnome.org/show_bug.cgi?id=652288

gst/avi/gstavidemux.c

index 5f2673b..8ada527 100644 (file)
@@ -4472,7 +4472,7 @@ gst_avi_demux_invert (GstAviStream * stream, GstBuffer * buf)
 
   h = stream->strf.vids->height;
   w = stream->strf.vids->width;
-  stride = w * (bpp / 8);
+  stride = GST_ROUND_UP_4 (w * (bpp / 8));
 
   buf = gst_buffer_make_writable (buf);
   if (GST_BUFFER_SIZE (buf) < (stride * h)) {