summaryrefslogtreecommitdiffstats
path: root/gst/mxf/mxfalaw.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/mxfalaw.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/mxfalaw.c')
-rw-r--r--gst/mxf/mxfalaw.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gst/mxf/mxfalaw.c b/gst/mxf/mxfalaw.c
index db7456cb..52df480f 100644
--- a/gst/mxf/mxfalaw.c
+++ b/gst/mxf/mxfalaw.c
@@ -196,12 +196,12 @@ mxf_alaw_get_descriptor (GstPadTemplate * tmpl, GstCaps * caps,
gint rate, channels;
s = gst_caps_get_structure (caps, 0);
- if (strcmp (gst_structure_get_name (s), "audio/x-alaw") != 0)
- return NULL;
-
- if (!gst_structure_get_int (s, "rate", &rate) ||
- !gst_structure_get_int (s, "channels", &channels))
+ if (strcmp (gst_structure_get_name (s), "audio/x-alaw") != 0 ||
+ !gst_structure_get_int (s, "rate", &rate) ||
+ !gst_structure_get_int (s, "channels", &channels)) {
+ GST_ERROR ("Invalid caps %" GST_PTR_FORMAT, caps);
return NULL;
+ }
ret = (MXFMetadataGenericSoundEssenceDescriptor *)
gst_mini_object_new (MXF_TYPE_METADATA_GENERIC_SOUND_ESSENCE_DESCRIPTOR);
@@ -210,7 +210,11 @@ mxf_alaw_get_descriptor (GstPadTemplate * tmpl, GstCaps * caps,
memcpy (&ret->sound_essence_compression, &mxf_sound_essence_compression_alaw,
16);
- mxf_metadata_generic_sound_essence_descriptor_from_caps (ret, caps);
+ if (!mxf_metadata_generic_sound_essence_descriptor_from_caps (ret, caps)) {
+ gst_mini_object_unref (GST_MINI_OBJECT_CAST (ret));
+ return NULL;
+ }
+
*handler = mxf_alaw_write_func;
md = g_new0 (ALawMappingData, 1);