Commit a6595e62 authored by Mark Harris's avatar Mark Harris Committed by Jean-Marc Valin

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's avatarJean-Marc Valin <jmvalin@jmvalin.ca>
parent 7c49ad0c
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment