From e601988ddd9fe3c9a830f8b722613d60944f6f06 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Fri, 21 May 2010 20:48:34 -0700 Subject: [PATCH] cogcolorspace: resample YUV->YUV conversions Fixes a segfault (bug #618044). --- ext/cog/gstcogcolorspace.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ext/cog/gstcogcolorspace.c b/ext/cog/gstcogcolorspace.c index 8d83fd22c8..09c71de995 100644 --- a/ext/cog/gstcogcolorspace.c +++ b/ext/cog/gstcogcolorspace.c @@ -459,13 +459,16 @@ gst_cogcolorspace_transform (GstBaseTransform * base_transform, } if (gst_video_format_is_yuv (out_format) && - gst_video_format_is_yuv (in_format) && - (in_color_matrix != out_color_matrix || - in_chroma_site != out_chroma_site)) { - frame = cog_virt_frame_new_subsample (frame, COG_FRAME_FORMAT_U8_444, + gst_video_format_is_yuv (in_format)) { + if ((in_color_matrix != out_color_matrix || + in_chroma_site != out_chroma_site)) { + frame = cog_virt_frame_new_subsample (frame, COG_FRAME_FORMAT_U8_444, + in_chroma_site, (compress->quality >= 5) ? 8 : 6); + frame = cog_virt_frame_new_color_matrix_YCbCr_to_YCbCr (frame, + in_color_matrix, out_color_matrix, 8); + } + frame = cog_virt_frame_new_subsample (frame, new_subsample, in_chroma_site, (compress->quality >= 5) ? 8 : 6); - frame = cog_virt_frame_new_color_matrix_YCbCr_to_YCbCr (frame, - in_color_matrix, out_color_matrix, 8); } if (gst_video_format_is_rgb (out_format) &&