aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/extract_mvs.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-18 21:38:45 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-27 07:20:59 +0100
commitb7d4a08f0d4563f3d411eb4fd692625d03b37e19 (patch)
treef5117c5ff4dd8b274010fb663a31e59b0ce5e75b /doc/examples/extract_mvs.c
parent9475175ec0da425955e0ada4c8d43453215f6c8b (diff)
downloadffmpeg-b7d4a08f0d4563f3d411eb4fd692625d03b37e19.tar.gz
avcodec/fft_template, fft_init_table: Make ff_fft_init() thread-safe
Commit 1af615683e4a1a858407afbaa2fd686842da7e49 put initializing the ff_fft_offsets_lut (which is typically used if FFT_FIXED_32) behind an ff_thread_once() to make ff_fft_init() thread-safe; yet there is a second place where said table may be initialized which is not guarded by this AVOnce: ff_fft_init_mips(). MIPS uses this LUT even for ordinary floating point FFTs, so that ff_fft_init() is not thread-safe (on MIPS) for both 32bit fixed-point as well as floating-point FFTs; e.g. ff_mdct_init() inherits this flaw and therefore initializing e.g. the AAC decoders is not thread-safe (on MIPS) despite them having FF_CODEC_CAP_INIT_CLEANUP set. This commit fixes this by moving the AVOnce to fft_init_table.c and using it to guard all initializations of ff_fft_offsets_lut. (It is not that bad in practice, because every entry of ff_fft_offsets_lut is never read during initialization and is only once ever written to (namely to its final value); but even these are conflicting actions which are (by definition) data races and lead to undefined behaviour.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> (cherry picked from commit b9c1ab89078d862e0146c9d7ed277addd770e3a3)
Diffstat (limited to 'doc/examples/extract_mvs.c')
0 files changed, 0 insertions, 0 deletions