Commit 326940f8 authored by Arun Raghavan's avatar Arun Raghavan

video-color: Deal with NULL colorimetry while converting from string

This came up in the case where v4l2 sets caps with colorimetry=NULL, and
then tries to parse back the colorimetry, causing a crash in
gst_video_get_colorimetry() because of g_str_equal(). We fix this by
making sure the only caller of the function never calls it with a null
colorimetry string.
parent aa759d42
......@@ -118,7 +118,10 @@ gst_video_colorimetry_from_string (GstVideoColorimetry * cinfo,
const ColorimetryInfo *ci;
gboolean res = FALSE;
if ((ci = gst_video_get_colorimetry (color))) {
if (!color) {
*cinfo = colorimetry[DEFAULT_UNKNOWN].color;
res = TRUE;
} else if ((ci = gst_video_get_colorimetry (color))) {
*cinfo = ci->color;
res = TRUE;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment