[FFmpeg-cvslog] qdm2: increase noise_table size

Michael Niedermayer git at videolan.org
Mon Jan 28 19:44:48 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Jan 28 19:34:55 2013 +0100| [8c4aebb58d00fd613f3f684bf0f869966149ae78] | committer: Michael Niedermayer

qdm2: increase noise_table size

This prevents out of array reads. An alternative solution would be
to check the index but this would require several checks in the
inner loops

Yet another alternative would be to change the index reset logic
but this likely would introduce a difference to the binary decoder

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8c4aebb58d00fd613f3f684bf0f869966149ae78
---

 libavcodec/qdm2_tablegen.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/qdm2_tablegen.h b/libavcodec/qdm2_tablegen.h
index 585edfd..a90682f 100644
--- a/libavcodec/qdm2_tablegen.h
+++ b/libavcodec/qdm2_tablegen.h
@@ -37,7 +37,7 @@
 #include "libavcodec/qdm2_tables.h"
 #else
 static uint16_t softclip_table[HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1];
-static float noise_table[4096];
+static float noise_table[4096 + 20];
 static uint8_t random_dequant_index[256][5];
 static uint8_t random_dequant_type24[128][3];
 static float noise_samples[128];



More information about the ffmpeg-cvslog mailing list