summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2010-09-06 14:10:11 +0200
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2011-02-07 19:59:21 +0100
commitc85e8e8015b7239df7819fc2eaa0a21158f1e250 (patch)
tree87e0f8b2e522cc97385901e0ceb036f2d1fcf05e
parentd6d48cfb7091b2bcfd8e4dba3a7eaafce668b1f0 (diff)
amrparse: a valid amr-wb frame should not have reserved frame type index
See #639715.
-rw-r--r--gst/audioparsers/gstamrparse.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gst/audioparsers/gstamrparse.c b/gst/audioparsers/gstamrparse.c
index a668817ae..42481a2b2 100644
--- a/gst/audioparsers/gstamrparse.c
+++ b/gst/audioparsers/gstamrparse.c
@@ -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;
}