riff-media: Handle strf_data being NULL

Instead of trying to get the size of a NULL buffer :)
This commit is contained in:
Edward Hervey 2017-11-02 09:19:21 +01:00 committed by Edward Hervey
parent 62081fe583
commit ee55f94ac0

View file

@ -1594,12 +1594,17 @@ gst_riff_create_audio_caps (guint16 codec_id,
GstMapInfo info; GstMapInfo info;
gsize size; 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 */ /* should be at least 22 bytes */
size = gst_buffer_get_size (strf_data); 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 GST_WARNING ("WAVE_FORMAT_EXTENSIBLE data size is %" G_GSIZE_FORMAT
" (expected: 22)", (strf_data) ? size : -1); " (expected: 22)", size);
return NULL; return NULL;
} }