aboutsummaryrefslogtreecommitdiff
path: root/src/opus_multistream_encoder.c
diff options
context:
space:
mode:
authorMark Harris <mark.hsj@gmail.com>2015-10-07 09:21:23 -0400
committerJean-Marc Valin <jmvalin@jmvalin.ca>2015-10-07 09:23:33 -0400
commita6595e6201064f34d1795be4e8d1412e426b233b (patch)
tree9eebb310c48954aff8c4206f4ae07098ec907b25 /src/opus_multistream_encoder.c
parent7c49ad0c5b1cd5ee830f449a34cc32b469db3cee (diff)
downloadlibopus-a6595e6201064f34d1795be4e8d1412e426b233b.tar.gz
Extra safety against NaNs in surround_analysis()
Fix out-of-bounds memory read in multichannel surround analysis with float input that contains NaNs. Found by afl-fuzz. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
Diffstat (limited to 'src/opus_multistream_encoder.c')
-rw-r--r--src/opus_multistream_encoder.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opus_multistream_encoder.c b/src/opus_multistream_encoder.c
index b55ab7ac..aa6a2672 100644
--- a/src/opus_multistream_encoder.c
+++ b/src/opus_multistream_encoder.c
@@ -202,7 +202,7 @@ static opus_val16 logSum(opus_val16 a, opus_val16 b)
max = b;
diff = SUB32(EXTEND32(b),EXTEND32(a));
}
- if (diff >= QCONST16(8.f, DB_SHIFT))
+ if (!(diff < QCONST16(8.f, DB_SHIFT))) /* inverted to catch NaNs */
return max;
#ifdef FIXED_POINT
low = SHR32(diff, DB_SHIFT-1);