summaryrefslogtreecommitdiff
path: root/ext/openjpeg/gstopenjpegdec.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openjpeg/gstopenjpegdec.c')
-rw-r--r--ext/openjpeg/gstopenjpegdec.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/ext/openjpeg/gstopenjpegdec.c b/ext/openjpeg/gstopenjpegdec.c
index 33fdf1df5..d027e960a 100644
--- a/ext/openjpeg/gstopenjpegdec.c
+++ b/ext/openjpeg/gstopenjpegdec.c
@@ -171,13 +171,14 @@ gst_openjpeg_dec_set_format (GstVideoDecoder * decoder,
g_return_val_if_reached (FALSE);
}
- color_space = gst_structure_get_string (s, "colorspace");
- if (g_str_equal (color_space, "sRGB"))
- self->color_space = CLRSPC_SRGB;
- else if (g_str_equal (color_space, "GRAY"))
- self->color_space = CLRSPC_GRAY;
- else if (g_str_equal (color_space, "sYUV"))
- self->color_space = CLRSPC_SYCC;
+ if ((color_space = gst_structure_get_string (s, "colorspace"))) {
+ if (g_str_equal (color_space, "sRGB"))
+ self->color_space = CLRSPC_SRGB;
+ else if (g_str_equal (color_space, "GRAY"))
+ self->color_space = CLRSPC_GRAY;
+ else if (g_str_equal (color_space, "sYUV"))
+ self->color_space = CLRSPC_SYCC;
+ }
self->ncomps = 0;
gst_structure_get_int (s, "num-components", &self->ncomps);