summaryrefslogtreecommitdiffstats
path: root/gst/mxf/mxfup.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/mxfup.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/mxfup.c')
-rw-r--r--gst/mxf/mxfup.c27
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;