summaryrefslogtreecommitdiffstats
path: root/gst/mxf/mxfjpeg2000.c
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-03-22 15:51:37 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-03-22 15:51:37 +0100
commiteffb5786da04e28effadc0602ef1ec5465458801 (patch)
tree0c187c241f51bda6bcec5cccdba7df8330803c0c /gst/mxf/mxfjpeg2000.c
parentddced37a8b83be290343502d4099d8f325da4e3f (diff)
downloadgst-plugins-bad-effb5786da04e28effadc0602ef1ec5465458801.tar.gz
gst-plugins-bad-effb5786da04e28effadc0602ef1ec5465458801.tar.bz2
gst-plugins-bad-effb5786da04e28effadc0602ef1ec5465458801.zip
mxfmux: Fix some memory leaks, improve debugging and handle errors better
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;