From 2f3b2c586f535680bbc5b12c19d77280d3705bf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 9 Oct 2012 10:14:50 +0200 Subject: [PATCH] Also add some more output format checks to the audio decoder --- sys/androidmedia/gstamcaudiodec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/androidmedia/gstamcaudiodec.c b/sys/androidmedia/gstamcaudiodec.c index 7805695002..616365d619 100644 --- a/sys/androidmedia/gstamcaudiodec.c +++ b/sys/androidmedia/gstamcaudiodec.c @@ -456,6 +456,11 @@ gst_amc_audio_dec_set_src_caps (GstAmcAudioDec * self, GstAmcFormat * format) return FALSE; } + if (rate == 0 || channels == 0) { + GST_ERROR_OBJECT (self, "Rate or channels not set"); + return FALSE; + } + /* Not always present */ if (gst_amc_format_contains_key (format, "channel-mask")) gst_amc_format_get_int (format, "channel-mask", (gint *) & channel_mask);