diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-03-22 15:51:37 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-03-22 15:51:37 +0100 |
commit | effb5786da04e28effadc0602ef1ec5465458801 (patch) | |
tree | 0c187c241f51bda6bcec5cccdba7df8330803c0c /gst/mxf/mxfup.c | |
parent | ddced37a8b83be290343502d4099d8f325da4e3f (diff) | |
download | gst-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/mxfup.c')
-rw-r--r-- | gst/mxf/mxfup.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/gst/mxf/mxfup.c b/gst/mxf/mxfup.c index 412a6622..a86a2c19 100644 --- a/gst/mxf/mxfup.c +++ b/gst/mxf/mxfup.c @@ -424,10 +424,20 @@ mxf_up_get_rgba_descriptor (GstPadTemplate * tmpl, GstCaps * caps, gst_caps_unref (intersection); } + if (md->fourcc == 0) { + GST_ERROR ("Invalid caps %" GST_PTR_FORMAT, caps); + gst_mini_object_unref (GST_MINI_OBJECT_CAST (ret)); + return NULL; + } + + memcpy (&ret->parent.parent.essence_container, &up_essence_container_ul, 16); - 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; + } md->width = ret->parent.stored_width; md->height = ret->parent.stored_height; @@ -469,10 +479,19 @@ mxf_up_get_cdci_descriptor (GstPadTemplate * tmpl, GstCaps * caps, gst_caps_unref (intersection); } + if (md->fourcc == 0) { + GST_ERROR ("Invalid caps %" GST_PTR_FORMAT, caps); + gst_mini_object_unref (GST_MINI_OBJECT_CAST (ret)); + return NULL; + } + memcpy (&ret->parent.parent.essence_container, &up_essence_container_ul, 16); - 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; + } md->width = ret->parent.stored_width; md->height = ret->parent.stored_height; |