From 78e8b33c388e7297bf300eada8564ff624b39c8f Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 23 Mar 2011 12:02:35 -0300 Subject: [PATCH] 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 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c index 83330c0224..fd265a13e6 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: