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 14:02:07 +0200
commit461e306bec11d9db189739b9a85f95ff31be93da (patch)
tree2e7ec239e1979d2f361f274b79e24938e3b61626
parent60282e0c1d148da01edcf4f63c59f3c708482660 (diff)
downloadgstreamer-plugins-base-461e306bec11d9db189739b9a85f95ff31be93da.tar.gz
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? */