|
From: <mn...@ke...> - 2011-02-07 19:00:40
|
Module: gst-plugins-bad Branch: master Commit: c85e8e8015b7239df7819fc2eaa0a21158f1e250 URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=c85e8e8015b7239df7819fc2eaa0a21158f1e250 Author: Mark Nauwelaerts <mar...@co...> Date: Mon Sep 6 14:10:11 2010 +0200 amrparse: a valid amr-wb frame should not have reserved frame type index See #639715. --- gst/audioparsers/gstamrparse.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/audioparsers/gstamrparse.c b/gst/audioparsers/gstamrparse.c index a668817..42481a2 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; } |