a52dec: check that a52_init returns a valid a52 state

This commit is contained in:
Julien Isorce 2011-12-20 11:54:38 +01:00 committed by Mark Nauwelaerts
parent d55d4054bd
commit 24fca6cde5

View file

@ -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;