mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
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.
This commit is contained in:
parent
aa759d4204
commit
326940f89a
1 changed files with 4 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue