summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-12-18 13:24:22 +0100
committerTim-Philipp Müller <tim@centricular.com>2015-06-10 19:27:23 +0100
commit6984d039ddc5f5c77af7d03af1e1228d43c8fc42 (patch)
tree0118dbd768172913f653bd6dffe0ea3e56fa9b1b
parent5d1690f8b71bb290b27f7dccb8033ade22834dcb (diff)
downloadgstreamer-plugins-base-6984d039ddc5f5c77af7d03af1e1228d43c8fc42.tar.gz
riff-media: Error out early if we observe an invalid audio format
-rw-r--r--gst-libs/gst/riff/riff-media.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c
index 02a68b16a..b3705039a 100644
--- a/gst-libs/gst/riff/riff-media.c
+++ b/gst-libs/gst/riff/riff-media.c
@@ -1227,6 +1227,10 @@ gst_riff_create_audio_caps (guint16 codec_id,
format =
gst_audio_format_build_integer (wd != 8, G_LITTLE_ENDIAN, wd, ws);
+ if (format == GST_AUDIO_FORMAT_UNKNOWN) {
+ GST_WARNING ("Unsupported raw audio format with width %d", wd);
+ return NULL;
+ }
caps = gst_caps_new_simple ("audio/x-raw",
"format", G_TYPE_STRING, gst_audio_format_to_string (format),