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
This commit is contained in:
Thiago Santos 2011-03-23 12:02:35 -03:00
parent 2ab592bac9
commit 78e8b33c38

View file

@ -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: