[0.11] gst-plugins-ugly: a52dec: check that a52_init returns a valid a52 state

Sebastian Dröge slomo at kemper.freedesktop.org
Tue Jan 10 06:17:27 PST 2012


Module: gst-plugins-ugly
Branch: 0.11
Commit: 24fca6cde5bde1ff679433c0744add20255bb04a
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=24fca6cde5bde1ff679433c0744add20255bb04a

Author: Julien Isorce <julien.isorce at gmail.com>
Date:   Tue Dec 20 11:54:38 2011 +0100

a52dec: check that a52_init returns a valid a52 state

---

 ext/a52dec/gsta52dec.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/ext/a52dec/gsta52dec.c b/ext/a52dec/gsta52dec.c
index ac1462e..5827f57 100644
--- a/ext/a52dec/gsta52dec.c
+++ b/ext/a52dec/gsta52dec.c
@@ -248,6 +248,13 @@ gst_a52dec_start (GstAudioDecoder * dec)
 
   klass = GST_A52DEC_CLASS (G_OBJECT_GET_CLASS (a52dec));
   a52dec->state = a52_init (klass->a52_cpuflags);
+
+  if (!a52dec->state) {
+    GST_ELEMENT_ERROR (GST_ELEMENT (a52dec), LIBRARY, INIT, (NULL),
+        ("failed to initialize a52 state"));
+    return FALSE;
+  }
+
   a52dec->samples = a52_samples (a52dec->state);
   a52dec->bit_rate = -1;
   a52dec->sample_rate = -1;



More information about the gstreamer-commits mailing list