summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2017-11-02 09:19:21 +0100
committerEdward Hervey <bilboed@bilboed.com>2017-12-01 10:02:03 +0100
commita8f610f2ce61c922f90dae4b971cba687fee0c86 (patch)
treece01329b8b00f9aee33a8aaf72ea05e7bf1509f7
parent0cbe7b66219bc769e1e235b8498b6503e0e1989c (diff)
downloadgstreamer-plugins-base-a8f610f2ce61c922f90dae4b971cba687fee0c86.tar.gz
riff-media: Handle strf_data being NULL
Instead of trying to get the size of a NULL buffer :)
-rw-r--r--gst-libs/gst/riff/riff-media.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gst-libs/gst/riff/riff-media.c b/gst-libs/gst/riff/riff-media.c
index c227835f8..2d6aa55d8 100644
--- a/gst-libs/gst/riff/riff-media.c
+++ b/gst-libs/gst/riff/riff-media.c
@@ -1594,12 +1594,17 @@ gst_riff_create_audio_caps (guint16 codec_id,
GstMapInfo info;
gsize size;
+ if (strf_data == NULL) {
+ GST_WARNING ("WAVE_FORMAT_EXTENSIBLE but no strf_data buffer provided");
+ return NULL;
+ }
+
/* should be at least 22 bytes */
size = gst_buffer_get_size (strf_data);
- if (strf_data == NULL || size < 22) {
+ if (size < 22) {
GST_WARNING ("WAVE_FORMAT_EXTENSIBLE data size is %" G_GSIZE_FORMAT
- " (expected: 22)", (strf_data) ? size : -1);
+ " (expected: 22)", size);
return NULL;
}