aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-10-14 23:48:23 +0200
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>2018-10-19 20:30:48 +0200
commit10f468156c0109a06854b5d672c5209a88923ce9 (patch)
tree2cba12cbd22ba8d3303d677ace8182dd645c9e96
parentfeb05ffa99fc3633e5dd97916ac67dc4e7c76ab2 (diff)
downloadffmpeg-10f468156c0109a06854b5d672c5209a88923ce9.tar.gz
lavc/sinewin: Do not declare AAC 120/960 tables as const.
ff_sine_window_init() is writing to these tables causing a crash if compiled with gcc 8 and lto. Analyzed by Martin Liška in: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85132 Fixes ticket #7491.
-rw-r--r--libavcodec/sinewin.h7
-rw-r--r--libavcodec/sinewin_tablegen.h4
-rw-r--r--libavcodec/sinewin_tablegen_template.c2
-rw-r--r--libavcodec/version.h2
4 files changed, 10 insertions, 5 deletions
diff --git a/libavcodec/sinewin.h b/libavcodec/sinewin.h
index 6b97a7185f..329e9bb5be 100644
--- a/libavcodec/sinewin.h
+++ b/libavcodec/sinewin.h
@@ -38,6 +38,9 @@
#define SINETABLE(size) \
SINETABLE_CONST DECLARE_ALIGNED(32, INTFLOAT, AAC_RENAME(ff_sine_##size))[size]
+#define SINETABLE120960(size) \
+ DECLARE_ALIGNED(32, INTFLOAT, AAC_RENAME(ff_sine_##size))[size]
+
/**
* Generate a sine window.
* @param window pointer to half window
@@ -52,11 +55,11 @@ void AAC_RENAME(ff_init_ff_sine_windows)(int index);
extern SINETABLE( 32);
extern SINETABLE( 64);
-extern SINETABLE( 120);
+extern SINETABLE120960(120);
extern SINETABLE( 128);
extern SINETABLE( 256);
extern SINETABLE( 512);
-extern SINETABLE( 960);
+extern SINETABLE120960(960);
extern SINETABLE(1024);
extern SINETABLE(2048);
extern SINETABLE(4096);
diff --git a/libavcodec/sinewin_tablegen.h b/libavcodec/sinewin_tablegen.h
index 0fa3561abc..dc52234ed0 100644
--- a/libavcodec/sinewin_tablegen.h
+++ b/libavcodec/sinewin_tablegen.h
@@ -32,8 +32,8 @@
#include "libavutil/common.h"
#if !USE_FIXED
-SINETABLE( 120);
-SINETABLE( 960);
+SINETABLE120960(120);
+SINETABLE120960(960);
#endif
#if !CONFIG_HARDCODED_TABLES
SINETABLE( 32);
diff --git a/libavcodec/sinewin_tablegen_template.c b/libavcodec/sinewin_tablegen_template.c
index 43ce1ba82e..b8eb407bd8 100644
--- a/libavcodec/sinewin_tablegen_template.c
+++ b/libavcodec/sinewin_tablegen_template.c
@@ -33,6 +33,8 @@
#define SINETABLE_CONST
#define SINETABLE(size) \
INTFLOAT AAC_RENAME(ff_sine_##size)[size]
+#define SINETABLE120960(size) \
+ INTFLOAT AAC_RENAME(ff_sine_##size)[size]
#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
#include "sinewin_tablegen.h"
#include "tableprint.h"
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 0d9a28f432..9098882f47 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 33
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MICRO 102
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \