mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-19 20:46:22 +00:00
jpeg2000parse: Don't pass NULL strings to the colorspace / sampling parsing functions
They assert on NULL.
This commit is contained in:
parent
31d0a2c1ea
commit
8daf628910
1 changed files with 10 additions and 6 deletions
|
@ -188,6 +188,7 @@ gst_jpeg2000_parse_handle_frame (GstBaseParse * parse,
|
||||||
guint eoc_offset = 0;
|
guint eoc_offset = 0;
|
||||||
GstCaps *current_caps = NULL;
|
GstCaps *current_caps = NULL;
|
||||||
GstStructure *current_caps_struct = NULL;
|
GstStructure *current_caps_struct = NULL;
|
||||||
|
const gchar *colorspace_string = NULL;
|
||||||
GstJPEG2000Colorspace colorspace = GST_JPEG2000_COLORSPACE_NONE;
|
GstJPEG2000Colorspace colorspace = GST_JPEG2000_COLORSPACE_NONE;
|
||||||
guint x0, y0, x1, y1;
|
guint x0, y0, x1, y1;
|
||||||
guint width = 0, height = 0;
|
guint width = 0, height = 0;
|
||||||
|
@ -196,6 +197,7 @@ gst_jpeg2000_parse_handle_frame (GstBaseParse * parse,
|
||||||
guint16 numcomps;
|
guint16 numcomps;
|
||||||
guint16 compno;
|
guint16 compno;
|
||||||
GstJPEG2000Sampling parsed_sampling = GST_JPEG2000_SAMPLING_NONE;
|
GstJPEG2000Sampling parsed_sampling = GST_JPEG2000_SAMPLING_NONE;
|
||||||
|
const gchar *sink_sampling_string = NULL;
|
||||||
GstJPEG2000Sampling sink_sampling = GST_JPEG2000_SAMPLING_NONE;
|
GstJPEG2000Sampling sink_sampling = GST_JPEG2000_SAMPLING_NONE;
|
||||||
GstJPEG2000Sampling source_sampling = GST_JPEG2000_SAMPLING_NONE;
|
GstJPEG2000Sampling source_sampling = GST_JPEG2000_SAMPLING_NONE;
|
||||||
guint magic_offset = 0;
|
guint magic_offset = 0;
|
||||||
|
@ -337,12 +339,14 @@ gst_jpeg2000_parse_handle_frame (GstBaseParse * parse,
|
||||||
goto beach;
|
goto beach;
|
||||||
}
|
}
|
||||||
|
|
||||||
colorspace =
|
colorspace_string = gst_structure_get_string
|
||||||
gst_jpeg2000_colorspace_from_string (gst_structure_get_string
|
(current_caps_struct, "colorspace");
|
||||||
(current_caps_struct, "colorspace"));
|
if (colorspace_string)
|
||||||
sink_sampling =
|
colorspace = gst_jpeg2000_colorspace_from_string (colorspace_string);
|
||||||
gst_jpeg2000_sampling_from_string (gst_structure_get_string
|
sink_sampling_string = gst_structure_get_string
|
||||||
(current_caps_struct, "sampling"));
|
(current_caps_struct, "sampling");
|
||||||
|
if (sink_sampling_string)
|
||||||
|
sink_sampling = gst_jpeg2000_sampling_from_string (sink_sampling_string);
|
||||||
|
|
||||||
for (compno = 0; compno < numcomps; ++compno) {
|
for (compno = 0; compno < numcomps; ++compno) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue