Protect ACM decoder buffer in stereo.

In https://code.google.com/p/webrtc/source/detail?r=8730, I did a protection on ACM decoder buffer from being overflow.

However, the I misunderstood the return unit for PacketDuration(), and therefore, stereo decoders are not well protected.

This CL fixed this.

BUG=4361
R=henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/47289004

Cr-Commit-Position: refs/heads/master@{#9275}
This commit is contained in:
Minyue
2015-05-25 13:49:37 +02:00
parent 57e5fd2e60
commit 323b132f5e
4 changed files with 28 additions and 24 deletions

View File

@ -288,7 +288,8 @@ int16_t WebRtcOpus_DecodeFec(OpusDecInst* inst, const uint8_t* encoded,
* - payload : Encoded data pointer
* - payload_length_bytes : Bytes of encoded data
*
* Return value : The duration of the packet, in samples.
* Return value : The duration of the packet, in samples per
* channel.
*/
int WebRtcOpus_DurationEst(OpusDecInst* inst,
const uint8_t* payload,
@ -308,7 +309,7 @@ int WebRtcOpus_DurationEst(OpusDecInst* inst,
* - payload_length_bytes : Bytes of encoded data
*
* Return value : >0 - The duration of the FEC data in the
* packet in samples.
* packet in samples per channel.
* 0 - No FEC data in the packet.
*/
int WebRtcOpus_FecDurationEst(const uint8_t* payload,