summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-11-26 13:53:49 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-11-26 13:54:41 +0200
commit0846eb5b27567aeadfc1d15c737a4083a7f0beee (patch)
treec155961629d60011aaa84d8d707ab1a71870c53c
parent69c1e0d7a9c6b8935c8aea5fdb3ef429939c3f66 (diff)
riff-media: Check if caps are NULL before using them for the first time, not afterwards
Otherwise we'll get a g_critical() before erroring out cleanly on https://samples.mplayerhq.hu/A-codecs/ATRAC3/SND0.AT3
-rw-r--r--gst-libs/gst/riff/riff-media.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c
index 31d6d1b7d..a103a389c 100644
--- a/gst-libs/gst/riff/riff-media.c
+++ b/gst-libs/gst/riff/riff-media.c
@@ -1732,6 +1732,11 @@ gst_riff_create_audio_caps (guint16 codec_id,
*codec_name = g_strdup ("Ogg-AVI");
}
+ if (caps == NULL) {
+ GST_WARNING ("Unknown WAVE_FORMAT_EXTENSIBLE audio format");
+ return NULL;
+ }
+
if (strf != NULL) {
/* If channel_mask == 0 and channels > 1 let's
* assume default layout as some wav files don't have the
@@ -1750,10 +1755,6 @@ gst_riff_create_audio_caps (guint16 codec_id,
rate_chan = FALSE;
}
- if (caps == NULL) {
- GST_WARNING ("Unknown WAVE_FORMAT_EXTENSIBLE audio format");
- return NULL;
- }
break;
}
/* can anything decode these? pitfdll? */