asfdemux: Add sanity check for asf_stream_audio

We should have enough bytes for the specified codec_data

https://bugzilla.gnome.org/show_bug.cgi?id=775070
This commit is contained in:
Edward Hervey 2016-11-25 10:07:35 +01:00 committed by Edward Hervey
parent 8f05e8f449
commit 4a52e6c827

View file

@ -2507,6 +2507,11 @@ gst_asf_demux_get_stream_audio (asf_stream_audio * audio, guint8 ** p_data,
audio->word_size = gst_asf_demux_get_uint16 (p_data, p_size);
/* Codec specific data size */
audio->size = gst_asf_demux_get_uint16 (p_data, p_size);
if (audio->size > *p_size) {
GST_WARNING ("Corrupted audio codec_data (should be at least %u bytes, is %"
G_GUINT64_FORMAT " long)", audio->size, *p_size);
return FALSE;
}
return TRUE;
}