Chromium Code Reviews

Unified Diff: src/opus_decoder.c

Issue 11575026: Fix possible integer overflow in Opus with ~16MB fed to the decoder. (Closed) Base URL: http://src.chromium.org/svn/trunk/
Patch Set: Fix possible integer overflow in Opus with ~16MB fed to the decoder. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« 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: src/opus_decoder.c
===================================================================
--- src/opus_decoder.c (revision 173381)
+++ src/opus_decoder.c (working copy)
@@ -612,16 +612,14 @@
/* Padding flag is bit 6 */
if (ch&0x40)
{
- int padding=0;
int p;
do {
if (len<=0)
return OPUS_INVALID_PACKET;
p = *data++;
len--;
- padding += p==255 ? 254: p;
+ len -= p==255 ? 254: p;
} while (p==255);
- len -= padding;
}
if (len<0)
return OPUS_INVALID_PACKET;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine