amrparse: a valid amr-wb frame should not have reserved frame type index

See #639715.
This commit is contained in:
Mark Nauwelaerts 2010-09-06 14:10:11 +02:00
parent d6d48cfb70
commit c85e8e8015

View file

@ -64,7 +64,7 @@ static const gint block_size_nb[16] =
{ 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0 };
static const gint block_size_wb[16] =
{ 17, 23, 32, 36, 40, 46, 50, 58, 60, 5, 5, 0, 0, 0, 0, 0 };
{ 17, 23, 32, 36, 40, 46, 50, 58, 60, 5, -1, -1, -1, -1, 0, 0 };
/* AMR has a "hardcoded" framerate of 50fps */
#define AMR_FRAMES_PER_SECOND 50
@ -307,8 +307,9 @@ gst_amrparse_check_valid_frame (GstBaseParse * parse,
* to contain a valid header as well (and there is enough data to
* perform this check)
*/
if (GST_BASE_PARSE_FRAME_SYNC (frame) || GST_BASE_PARSE_FRAME_DRAIN (frame)
|| (dsize > fsize && (data[fsize] & 0x83) == 0)) {
if (fsize &&
(GST_BASE_PARSE_FRAME_SYNC (frame) || GST_BASE_PARSE_FRAME_DRAIN (frame)
|| (dsize > fsize && (data[fsize] & 0x83) == 0))) {
*framesize = fsize;
return TRUE;
}