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

Unified Diff: deps/third_party/opus/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: Created 8 years 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 | src/third_party/opus/README.chromium » ('j') | src/third_party/opus/README.chromium » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: deps/third_party/opus/src/opus_decoder.c
===================================================================
--- deps/third_party/opus/src/opus_decoder.c (revision 173110)
+++ deps/third_party/opus/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 | src/third_party/opus/README.chromium » ('j') | src/third_party/opus/README.chromium » ('J')

Powered by Google App Engine
This is Rietveld 408576698