[0.11] gst-plugins-base: video: Getting component offsets without dimensions is fine if it is not YUV

Wim Taymans wtay at kemper.freedesktop.org
Wed Mar 30 12:41:09 PDT 2011


Module: gst-plugins-base
Branch: 0.11
Commit: 78e8b33c388e7297bf300eada8564ff624b39c8f
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=78e8b33c388e7297bf300eada8564ff624b39c8f

Author: Thiago Santos <thiago.sousa.santos at collabora.co.uk>
Date:   Wed Mar 23 12:02:35 2011 -0300

video: Getting component offsets without dimensions is fine if it is not YUV

This fixes a regression that an assertion would happen if
gst_video_get_component_offset would be called with width or
height as 0.

Calling it with 0 is fine if the format isn't yuv and this
was already being used in some other places of video.c

---

 gst-libs/gst/video/video.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c
index 83330c0..fd265a1 100644
--- a/gst-libs/gst/video/video.c
+++ b/gst-libs/gst/video/video.c
@@ -1730,7 +1730,8 @@ gst_video_format_get_component_offset (GstVideoFormat format,
 {
   g_return_val_if_fail (format != GST_VIDEO_FORMAT_UNKNOWN, 0);
   g_return_val_if_fail (component >= 0 && component <= 3, 0);
-  g_return_val_if_fail (width > 0 && height > 0, 0);
+  g_return_val_if_fail ((!gst_video_format_is_yuv (format)) || (width > 0
+          && height > 0), 0);
 
   switch (format) {
     case GST_VIDEO_FORMAT_I420:



More information about the gstreamer-commits mailing list