mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-19 05:45:58 +00:00
openjpegdec: Don't crash if colorspace is not provided on the caps
g_str_equal() is *not* NULL-safe
This commit is contained in:
parent
d70e43a069
commit
da8f8270c3
1 changed files with 8 additions and 7 deletions
|
@ -171,13 +171,14 @@ gst_openjpeg_dec_set_format (GstVideoDecoder * decoder,
|
||||||
g_return_val_if_reached (FALSE);
|
g_return_val_if_reached (FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
color_space = gst_structure_get_string (s, "colorspace");
|
if ((color_space = gst_structure_get_string (s, "colorspace"))) {
|
||||||
if (g_str_equal (color_space, "sRGB"))
|
if (g_str_equal (color_space, "sRGB"))
|
||||||
self->color_space = CLRSPC_SRGB;
|
self->color_space = CLRSPC_SRGB;
|
||||||
else if (g_str_equal (color_space, "GRAY"))
|
else if (g_str_equal (color_space, "GRAY"))
|
||||||
self->color_space = CLRSPC_GRAY;
|
self->color_space = CLRSPC_GRAY;
|
||||||
else if (g_str_equal (color_space, "sYUV"))
|
else if (g_str_equal (color_space, "sYUV"))
|
||||||
self->color_space = CLRSPC_SYCC;
|
self->color_space = CLRSPC_SYCC;
|
||||||
|
}
|
||||||
|
|
||||||
self->ncomps = 0;
|
self->ncomps = 0;
|
||||||
gst_structure_get_int (s, "num-components", &self->ncomps);
|
gst_structure_get_int (s, "num-components", &self->ncomps);
|
||||||
|
|
Loading…
Reference in a new issue