[FFmpeg-cvslog] avcodec/takdec: Skip last p2 sample (which is unused)
Michael Niedermayer
git at videolan.org
Sun Dec 6 12:57:18 CET 2015
ffmpeg | branch: release/2.4 | Michael Niedermayer <michael at niedermayer.cc> | Sun Nov 15 01:22:31 2015 +0100| [9356635e761a17a76f11c4adcfdd504d1e031a2d] | committer: Michael Niedermayer
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 at niedermayer.cc>
(cherry picked from commit 08b520636e96ba6888b669b9b3f4c414631ea1d2)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9356635e761a17a76f11c4adcfdd504d1e031a2d
---
libavcodec/takdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c
index 0e29c62..0b14849 100644
--- a/libavcodec/takdec.c
+++ b/libavcodec/takdec.c
@@ -632,7 +632,7 @@ static int decorrelate(TAKDecContext *s, int c1, int c2, int length)
for (; length2 > 0; length2 -= tmp) {
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;
for (i = 0; i < tmp; i++) {
More information about the ffmpeg-cvslog
mailing list