aacparse: make sure we have enough ADTS data

We need at least 6 bytes to pass over to _get_frame_len()
but we were just checking for a minimum of 2 bytes for the
syncword.

https://bugzilla.gnome.org/show_bug.cgi?id=724638
This commit is contained in:
Reynaldo H. Verdejo Pinochet 2014-02-19 13:35:59 -03:00
parent 0566ea06e5
commit c3a4bb1657

View file

@ -393,6 +393,14 @@ gst_aac_parse_check_adts_frame (GstAacParse * aacparse,
return FALSE;
if ((data[0] == 0xff) && ((data[1] & 0xf6) == 0xf0)) {
/* This looks like an ADTS frame header but
we need at least 6 bytes to proceed */
if (G_UNLIKELY (avail < 6)) {
*needed_data = 6;
return FALSE;
}
*framesize = gst_aac_parse_adts_get_frame_len (data);
/* In EOS mode this is enough. No need to examine the data further.