]> git.sesse.net Git - ffmpeg/commit
avcodec/mpegaudio_tablegen: Avoid write-only buffers
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 17 Nov 2020 22:20:03 +0000 (23:20 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 8 Dec 2020 16:51:47 +0000 (17:51 +0100)
commit22140374c8980420a3b5c65fcc11d90a04d35946
treed8a6033b4c4196c309c806d2e1c2b0b5143f296f
parent73bc26acb87e0e0ff74bc26bc9d7c54eceeb0145
avcodec/mpegaudio_tablegen: Avoid write-only buffers

The mpegaudio_tablegen header contains code to initialize several
tables; it is included in both the fixed as well as the floating point
mpegaudio decoders and some of these tables are only used by the fixed
resp. floating point decoders; yet both types are always initialized,
leaving the compiler to figure out that one of them is unused.

GCC 9.3 fails at this (even with -O3):
$ readelf -s mpegaudiodec_fixed.o|grep _float
    28: 0000000000001660 32768 OBJECT  LOCAL  DEFAULT    4 expval_table_float
An actually unused table (expval_table_fixed/float) of size 32KiB is kept
and initialized (the reason for this is probably that this table is read
from, namely to initialize another table: exp_table_fixed/float; of course
the float resp. fixed tables are not used in the fixed resp. floating point
decoder).

Therefore #ifdef the unneeded tables away.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/mpegaudio_tablegen.c
libavcodec/mpegaudio_tablegen.h