Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jmvalin@jmvalin.ca>2018-09-14 23:27:03 +0300
committerJean-Marc Valin <jmvalin@jmvalin.ca>2018-09-14 23:27:03 +0300
commit4a643d98c388727e73aebbe626a7379c6fddbbbe (patch)
tree37dc822e588dd4e9566696126103b477c02f2cc2
parentc6d977a966ccdb9ea684d8650cc6f8cccfedf8d7 (diff)
Fixes packet parsing for 16-bit CPUsv1.3-rc2
Without that change, a very long (> 682 ms) illegal packet could trigger a wrap-around in the test and be accepted as valid. Only 16-bit architectures (e.g. TI C5x) were affected.
-rw-r--r--src/opus.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opus.c b/src/opus.c
index cdbd13a1..538b5ea7 100644
--- a/src/opus.c
+++ b/src/opus.c
@@ -252,7 +252,7 @@ int opus_packet_parse_impl(const unsigned char *data, opus_int32 len,
/* Number of frames encoded in bits 0 to 5 */
ch = *data++;
count = ch&0x3F;
- if (count <= 0 || framesize*count > 5760)
+ if (count <= 0 || framesize*(opus_int32)count > 5760)
return OPUS_INVALID_PACKET;
len--;
/* Padding flag is bit 6 */