Commit ce15d773 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/apedec: Check length in long_filter_high_3800()

Fixes out of array read
Fixes: 0a7ff0c1d93da9cef28a315ec91b692a/asan_heap-oob_4a52e5_3604_9c56dbb20e308f4faeef7b35f688521a.ape

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cd7524fd)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 516525a1
...@@ -905,6 +905,9 @@ static void long_filter_high_3800(int32_t *buffer, int order, int shift, ...@@ -905,6 +905,9 @@ static void long_filter_high_3800(int32_t *buffer, int order, int shift,
int i, j; int i, j;
int32_t dotprod, sign; int32_t dotprod, sign;
if (order >= length)
return;
memset(coeffs, 0, order * sizeof(*coeffs)); memset(coeffs, 0, order * sizeof(*coeffs));
for (i = 0; i < order; i++) for (i = 0; i < order; i++)
delay[i] = buffer[i]; delay[i] = buffer[i];
......
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