Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: webrtc/modules/audio_coding/codecs/isac/main/source/isac.c

Issue 2315693002: iSAC float: Handle errors in upper band decoding (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
diff --git a/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c b/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
index e59f16f2c1ecc377e4a435046b203fcff93bba16..bf1cff4019aeb5007cd83ff5fd43738879beac04 100644
--- a/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
+++ b/webrtc/modules/audio_coding/codecs/isac/main/source/isac.c
@@ -1253,6 +1253,17 @@ static int Decode(ISACStruct* ISAC_main_inst,
return -1;
}
+ if (numDecodedBytesUB < 0) {
+ instISAC->errorCode = numDecodedBytesUB;
+ return -1;
+ }
+ if (numDecodedBytesLB + numDecodedBytesUB > lenEncodedBytes) {
+ // We have supposedly decoded more bytes than we were given. Likely
+ // caused by bad input data.
+ instISAC->errorCode = ISAC_LENGTH_MISMATCH;
+ return -1;
+ }
+
/* It might be less due to garbage. */
if ((numDecodedBytesUB != lenNextStream) &&
(numDecodedBytesUB != (lenNextStream -
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698