mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-13 02:45:35 +00:00
riff-media: Handle strf_data being NULL
Instead of trying to get the size of a NULL buffer :)
This commit is contained in:
parent
62081fe583
commit
ee55f94ac0
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue