summaryrefslogtreecommitdiffstats
path: root/gst/mxf/mxfjpeg2000.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst/mxf/mxfjpeg2000.c')
-rw-r--r--gst/mxf/mxfjpeg2000.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gst/mxf/mxfjpeg2000.c b/gst/mxf/mxfjpeg2000.c
index 9ff13f70..1f76d76a 100644
--- a/gst/mxf/mxfjpeg2000.c
+++ b/gst/mxf/mxfjpeg2000.c
@@ -232,11 +232,11 @@ mxf_jpeg2000_get_descriptor (GstPadTemplate * tmpl, GstCaps * caps,
guint32 fourcc;
s = gst_caps_get_structure (caps, 0);
- if (strcmp (gst_structure_get_name (s), "image/x-jpc") != 0)
- return NULL;
-
- if (!gst_structure_get_fourcc (s, "fourcc", &fourcc))
+ if (strcmp (gst_structure_get_name (s), "image/x-jpc") != 0 ||
+ !gst_structure_get_fourcc (s, "fourcc", &fourcc)) {
+ GST_ERROR ("Invalid caps %" GST_PTR_FORMAT, caps);
return NULL;
+ }
ret = (MXFMetadataRGBAPictureEssenceDescriptor *)
gst_mini_object_new (MXF_TYPE_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR);
@@ -268,8 +268,12 @@ mxf_jpeg2000_get_descriptor (GstPadTemplate * tmpl, GstCaps * caps,
g_assert_not_reached ();
}
- mxf_metadata_generic_picture_essence_descriptor_from_caps (&ret->parent,
- caps);
+ if (!mxf_metadata_generic_picture_essence_descriptor_from_caps (&ret->parent,
+ caps)) {
+ gst_mini_object_unref (GST_MINI_OBJECT_CAST (ret));
+ return NULL;
+ }
+
*handler = mxf_jpeg2000_write_func;
return (MXFMetadataFileDescriptor *) ret;