mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-12 10:15:22 +00:00
avcodec/takdec: Skip last p2 sample (which is unused)
Fixes out of array read
Fixes: cb3f38b08b4541523974667c7d1eee9e/asan_heap-oob_2659e18_9838_021fd5cd635bf76cede6398cd9ecbcdd.tak
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 08b520636e
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
ac7cc433ad
commit
6816644f34
@ -632,7 +632,7 @@ static int decorrelate(TAKDecContext *s, int c1, int c2, int length)
|
|||||||
for (; length2 > 0; length2 -= tmp) {
|
for (; length2 > 0; length2 -= tmp) {
|
||||||
tmp = FFMIN(length2, x);
|
tmp = FFMIN(length2, x);
|
||||||
|
|
||||||
for (i = 0; i < tmp; i++)
|
for (i = 0; i < tmp - (tmp == length2); i++)
|
||||||
s->residues[filter_order + i] = *p2++ >> dshift;
|
s->residues[filter_order + i] = *p2++ >> dshift;
|
||||||
|
|
||||||
for (i = 0; i < tmp; i++) {
|
for (i = 0; i < tmp; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user