From: "Ronald S. Bultje" <[email protected]>
WMApro (and all wma variants) actually support 13-bits block sizes, and
thus we should support that also. Some WMA functions do not enforce the
12-bit maximum, which causes crashes when decoding such a file because
it expects bigger buffers, which aren't there, causing overreads/writes
and all kind of bad stuff.
---
libavcodec/sinewin.h | 3 ++-
libavcodec/sinewin_tablegen.h | 3 ++-
libavcodec/wmaprodec.c | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/libavcodec/sinewin.h b/libavcodec/sinewin.h
index eefe5bf..8054191 100644
--- a/libavcodec/sinewin.h
+++ b/libavcodec/sinewin.h
@@ -53,7 +53,8 @@ extern SINETABLE( 512);
extern SINETABLE(1024);
extern SINETABLE(2048);
extern SINETABLE(4096);
+extern SINETABLE(8192);
-extern SINETABLE_CONST float * const ff_sine_windows[13];
+extern SINETABLE_CONST float * const ff_sine_windows[14];
#endif /* AVCODEC_SINEWIN_H */
diff --git a/libavcodec/sinewin_tablegen.h b/libavcodec/sinewin_tablegen.h
index 720f1ab..7d92026 100644
--- a/libavcodec/sinewin_tablegen.h
+++ b/libavcodec/sinewin_tablegen.h
@@ -38,6 +38,7 @@ SINETABLE( 512);
SINETABLE(1024);
SINETABLE(2048);
SINETABLE(4096);
+SINETABLE(8192);
#else
#include "libavcodec/sinewin_tables.h"
#endif
@@ -45,7 +46,7 @@ SINETABLE(4096);
SINETABLE_CONST float * const ff_sine_windows[] = {
NULL, NULL, NULL, NULL, NULL, // unused
ff_sine_32 , ff_sine_64 ,
- ff_sine_128, ff_sine_256, ff_sine_512, ff_sine_1024, ff_sine_2048,
ff_sine_4096
+ ff_sine_128, ff_sine_256, ff_sine_512, ff_sine_1024, ff_sine_2048,
ff_sine_4096, ff_sine_8192
};
// Generate a sine window.
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index a1b82db..0cbba82 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -105,7 +105,7 @@
#define MAX_FRAMESIZE 32768 ///< maximum
compressed frame size
#define WMAPRO_BLOCK_MIN_BITS 6
///< log2 of min block size
-#define WMAPRO_BLOCK_MAX_BITS 12
///< log2 of max block size
+#define WMAPRO_BLOCK_MAX_BITS 13
///< log2 of max block size
#define WMAPRO_BLOCK_MAX_SIZE (1 << WMAPRO_BLOCK_MAX_BITS)
///< maximum block size
#define WMAPRO_BLOCK_SIZES (WMAPRO_BLOCK_MAX_BITS - WMAPRO_BLOCK_MIN_BITS +
1) ///< possible block sizes
--
1.7.7.4
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel