Prevent crash in NetEQ when decoder overflow.

NetEQ can crash when decoder gives too many output samples than it can handle. A practical case this happens is when multiple opus packets are combined.

The best solution is to pass the max size to the ACM decode function and let it return a failure if the max size if too small.

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

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

Cr-Commit-Position: refs/heads/master@{#8730}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8730 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
minyue@webrtc.org
2015-03-16 12:30:37 +00:00
parent 4b89aa03bb
commit 7f7d7e3427
19 changed files with 453 additions and 188 deletions

View File

@ -35,11 +35,11 @@ struct IsacFloat {
static inline int16_t Create(instance_type** inst) {
return WebRtcIsac_Create(inst);
}
static inline int16_t Decode(instance_type* inst,
const uint8_t* encoded,
int16_t len,
int16_t* decoded,
int16_t* speech_type) {
static inline int16_t DecodeInternal(instance_type* inst,
const uint8_t* encoded,
int16_t len,
int16_t* decoded,
int16_t* speech_type) {
return WebRtcIsac_Decode(inst, encoded, len, decoded, speech_type);
}
static inline int16_t DecodePlc(instance_type* inst,