1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
FFmpeg/libavutil
Wan-Teh Chang fed50c4304 avutil: fix data race in av_get_cpu_flags()
Make the one-time initialization in av_get_cpu_flags() thread-safe. The
static variable |cpu_flags| in libavutil/cpu.c is read and written using
normal load and store operations. These are considered as data races.
The fix is to use atomic load and store operations.

The fix can be verified by running the libavutil/tests/cpu_init.c test
program under ThreadSanitizer:
    ./configure --toolchain=clang-tsan
    make libavutil/tests/cpu_init
    libavutil/tests/cpu_init

There should be no warnings from ThreadSanitizer.

Co-author: Dmitry Vyukov of Google, who suggested the data race fix.

Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-12-13 00:07:20 +01:00
..
aarch64 aarch64: Add an offset parameter to the movrel macro 2016-11-15 15:10:03 -05:00
arm arm: Clear the gp register alias at the end of functions 2016-11-15 15:10:03 -05:00
avr32 Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb' 2016-06-21 21:55:34 +02:00
bfin
mips avutil/mips: loongson add mmi utils header file 2016-10-23 03:23:09 +02:00
ppc
sh4
tests avutil/tests/imgutils: Remove unused variable 2016-12-13 00:06:53 +01:00
tomi
x86 avutil/x86/emms: Document the emms_c() vs alloc/free relation. 2016-10-23 13:02:37 +02:00
.gitignore Merge commit '257f00ec1ab06a2a161f535036c6512f3fc8e801' 2016-06-22 11:28:51 +02:00
adler32.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
adler32.h avutil: Group hash functions separately in Doxygen 2016-08-02 07:48:08 -07:00
aes_ctr.c avutil/aes_crt: free AVAESCTR struct properly 2016-02-03 19:33:23 -03:00
aes_ctr.h
aes_internal.h
aes.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
aes.h
atomic_gcc.h
atomic_suncc.h Merge commit '29c2d06d67724e994980045afa055c6c34611b30' 2016-02-24 17:31:44 +00:00
atomic_win32.h
atomic.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
atomic.h
attributes.h
audio_fifo.c avutil/audio_fifo: Use av_fifo_freep() and remove redundant if() 2016-10-14 17:08:51 +02:00
audio_fifo.h avfilter: add loop filters 2016-02-18 11:55:00 +01:00
avassert.h avutil/avassert: Add av_assertX_fpu() 2016-10-22 13:50:09 +02:00
avstring.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
avstring.h fix some a/an typos 2016-03-28 14:13:17 -08:00
avutil.h lavu: Add AVSphericalMapping type and frame side data 2016-12-07 14:39:04 -05:00
avutilres.rc
base64.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
base64.h lavu/base64: add AV_BASE64_DECODE_SIZE() macro 2016-04-02 12:48:21 +02:00
blowfish.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
blowfish.h
bprint.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
bprint.h
bswap.h
buffer_internal.h Merge commit '721a4efc0545548a241080b53ab480e34f366240' 2016-02-17 16:07:16 +00:00
buffer.c Merge commit '721a4efc0545548a241080b53ab480e34f366240' 2016-02-17 16:07:16 +00:00
buffer.h Merge commit '328e9a15c568843580ff3ff490748d545f16def8' 2016-04-13 17:27:01 +01:00
camellia.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
camellia.h
cast5.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
cast5.h
channel_layout.c avutil/channel_layout: AV_CH_LAYOUT_6POINT1_BACK not reachable in parsing 2016-03-10 21:24:25 +01:00
channel_layout.h
color_utils.c lavu: Adding ARIB STD-B67 (hybrid log-gamma) enum value and transfer function. 2016-06-01 16:32:08 +02:00
color_utils.h
colorspace.h Merge commit '1f77e634bb838f71ff21923b5e9fe3104c831c52' 2016-06-21 22:16:16 +02:00
common.h avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT 2016-01-27 16:36:46 +00:00
cpu_internal.h x86: add some more helper macros to check for slow cpuflags 2016-02-14 20:00:17 -03:00
cpu.c avutil: fix data race in av_get_cpu_flags() 2016-12-13 00:07:20 +01:00
cpu.h avutil: fix data race in av_get_cpu_flags() 2016-12-13 00:07:20 +01:00
crc.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
crc.h avutil: Add detailed Doxygen description to a few hashes 2016-08-02 07:48:21 -07:00
des.c Merge commit 'a6a750c7ef240b72ce01e9653343a0ddf247d196' 2016-06-22 13:44:34 +02:00
des.h
dict.c avformat: factorize iso 8601 timestamp writer to a dictionary avutil function 2016-08-17 23:45:41 +02:00
dict.h cosmetics: Fix spelling mistakes 2016-05-04 18:16:21 +02:00
display.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
display.h Added a selftest to libavutil/display.c 2016-03-22 17:24:55 +01:00
downmix_info.c
downmix_info.h
dynarray.h dynarray: Change AV_ to FF_ for AV_DYNARRAY_ADD 2016-07-31 10:19:03 -07:00
error.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
error.h
eval.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
eval.h
ffmath.h all: move ff_exp10, ff_exp10f, ff_fast_powf to lavu/ffmath.h 2016-03-22 10:15:31 -07:00
fifo.c libavutil/fifo: Fix fifo grow step 2016-06-03 14:49:56 +02:00
fifo.h
file_open.c lavu/file_open: Use current directory for temporary files also on Android. 2016-06-11 22:41:18 +02:00
file.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
file.h avutil/file: Move av_tempfile() to avutil/file_open ff_tempfile() 2016-03-12 02:08:34 +01:00
fixed_dsp.c x86/fixed_dsp: add ff_butterflies_fixed_sse2 2016-01-16 21:09:38 -03:00
fixed_dsp.h x86/fixed_dsp: add ff_butterflies_fixed_sse2 2016-01-16 21:09:38 -03:00
float_dsp.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
float_dsp.h
frame.c avutil/frame: fix indention after last commit 2016-11-16 21:25:45 +01:00
frame.h lavu: Add AVSphericalMapping type and frame side data 2016-12-07 14:39:04 -05:00
hash.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
hash.h avutil/hash: Add more detailed Doxygen documentation 2016-08-02 21:49:52 -07:00
hmac.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
hmac.h
hwcontext_cuda_internal.h avutil/hwcontext_cuda: use dynamically loaded CUDA 2016-11-22 10:34:27 +01:00
hwcontext_cuda.c avutil/hwcontext_cuda: check for missing pixel format 2016-11-30 12:36:23 +01:00
hwcontext_cuda.h avutil/hwcontext_cuda: use dynamically loaded CUDA 2016-11-22 10:34:27 +01:00
hwcontext_dxva2.c Merge commit '2ef87815fec059504370ae3050cc243a53553915' 2016-11-14 15:15:19 +01:00
hwcontext_dxva2.h Merge commit 'c46db38cde8e8fd8ecb1c6602f10ec0e002f29a8' 2016-06-22 22:38:49 +02:00
hwcontext_internal.h Merge commit '59e7361cc791e5103be1712dc59a2055f118d0da' 2016-09-28 13:30:27 -03:00
hwcontext_qsv.c Merge commit 'd20c118975220a0256027d1c2410bade94b8534d' 2016-11-14 15:18:49 +01:00
hwcontext_qsv.h Merge commit '59e7361cc791e5103be1712dc59a2055f118d0da' 2016-09-28 13:30:27 -03:00
hwcontext_vaapi.c Merge commit 'f62bb216ac4cfbbff16108c6bac35a0282532972' 2016-11-13 22:36:18 +01:00
hwcontext_vaapi.h hwcontext_vaapi: add a quirk for the missing MemoryType attribute 2016-11-13 20:39:49 +00:00
hwcontext_vdpau.c avutil/hwcontext_vdpau: Fix warning: "GET_CALLBACK" redefined 2016-10-10 02:41:24 +02:00
hwcontext_vdpau.h Merge commit 'a001ce31bc2bcf875a39b5fb22dae49120293b42' 2016-02-17 16:16:34 +00:00
hwcontext.c Merge commit 'fdfe01365d579189d9a55b3741dba2ac46eb1df8' 2016-11-13 22:35:49 +01:00
hwcontext.h Merge commit '5fcae3b3f93fd02b3d1e009b9d9b17410fca9498' 2016-11-13 22:35:04 +01:00
imgutils.c avutil: Add av_image_check_size2() 2016-12-10 22:24:10 +01:00
imgutils.h avutil: Add av_image_check_size2() 2016-12-10 22:24:10 +01:00
integer.c
integer.h
internal.h avformat: factorize iso 8601 timestamp writer to a dictionary avutil function 2016-08-17 23:45:41 +02:00
intfloat.h
intmath.c
intmath.h
intreadwrite.h
lfg.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
lfg.h
libavutil.v build: Change structure of the linker version script templates 2016-05-29 16:43:11 +02:00
libm.h
lls.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
lls.h
log2_tab.c
log.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
log.h lavu: remove comma at final enumeration items to fix pedantic warnings 2016-10-26 19:36:09 +02:00
lzo.c avutil/lzo: split test out into a separate file 2016-05-13 22:48:56 -03:00
lzo.h
macros.h
Makefile avutil/tests: run the cpu_init.c test conditionally on HAVE_THREADS 2016-12-10 18:47:10 -03:00
mastering_display_metadata.c libavutil: add mastering display metadata sidedata 2016-01-19 16:43:31 +01:00
mastering_display_metadata.h libavutil/mastering_display_metadata.h: change fields to be rationals as this is how they are typically coded. 2016-01-29 19:08:52 +01:00
mathematics.c
mathematics.h mathematics: Extend and edit Doxygen 2016-08-02 21:53:34 -07:00
md5.c Merge commit '41ed7ab45fc693f7d7fc35664c0233f4c32d69bb' 2016-06-21 21:55:34 +02:00
md5.h avutil: Group hash functions separately in Doxygen 2016-08-02 07:48:08 -07:00
mem_internal.h
mem.c dynarray: Change AV_ to FF_ for AV_DYNARRAY_ADD 2016-07-31 10:19:03 -07:00
mem.h avutil/mem: remove av_realloc / av_malloc incompatibility warning 2016-08-23 13:50:19 +02:00
motion_vector.h
murmur3.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
murmur3.h murmur3: Add Doxygen documentation 2016-08-02 07:50:44 -07:00
opencl_internal.c
opencl_internal.h all: Add missing header guards 2016-01-28 19:49:48 -08:00
opencl.c libavutil/opencl: fixed uninitialized var warning 2016-05-23 11:28:03 +02:00
opencl.h all: Make header guard names consistent 2016-01-31 15:44:11 -08:00
opt.c opt: reject denominator zero as out of range 2016-12-13 00:00:31 +01:00
opt.h avutil/opt: Add AV_OPT_TYPE_UINT64 2016-11-23 02:01:05 +01:00
parseutils.c avutil/parseutils: dont assume standard time when parsing a timestamp 2016-07-11 01:06:23 +02:00
parseutils.h
pca.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
pca.h
pixdesc.c avutil: add P016 pixel format 2016-11-22 10:07:43 -08:00
pixdesc.h pixdesc: Order function prototypes semantically 2016-10-05 17:17:50 -07:00
pixelutils.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
pixelutils.h
pixfmt.h avutil: add P016 pixel format 2016-11-22 10:07:43 -08:00
qsort.h all: Add missing header guards 2016-01-28 19:49:48 -08:00
random_seed.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
random_seed.h
rational.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
rational.h rational: Extend Doxygen 2016-08-02 21:52:40 -07:00
rc4.c
rc4.h
replaygain.h Merge commit '29c2d06d67724e994980045afa055c6c34611b30' 2016-02-24 17:31:44 +00:00
reverse.c
ripemd.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
ripemd.h avutil: Group hash functions separately in Doxygen 2016-08-02 07:48:08 -07:00
samplefmt.c swresample: add int64 sample format 2016-08-18 15:30:05 +02:00
samplefmt.h swresample: add int64 sample format 2016-08-18 15:30:05 +02:00
sha512.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
sha512.h avutil: Add detailed Doxygen description to a few hashes 2016-08-02 07:48:21 -07:00
sha.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
sha.h avutil: Add detailed Doxygen description to a few hashes 2016-08-02 07:48:21 -07:00
softfloat_ieee754.h avutil/softfloat_ieee754: make all functions inline 2016-11-05 17:53:26 -03:00
softfloat_tables.h
softfloat.h softfloat: decrease MIN_EXP to cover full float range 2016-11-25 01:23:48 +01:00
spherical.c lavu: Add AVSphericalMapping type and frame side data 2016-12-07 14:39:04 -05:00
spherical.h lavu: Add AVSphericalMapping type and frame side data 2016-12-07 14:39:04 -05:00
stereo3d.c Merge commit '0c4468dc185fa8b9e7d6add914595c5e928b24fd' 2016-06-23 12:38:51 +02:00
stereo3d.h Merge commit '0c4468dc185fa8b9e7d6add914595c5e928b24fd' 2016-06-23 12:38:51 +02:00
tablegen.h
tea.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
tea.h
thread.h lavu: add pthread asserts if ASSERT_LEVEL>1 2016-01-20 21:08:50 +01:00
threadmessage.c
threadmessage.h avutil/threadmessage.h: Fix swapped comments 2016-06-16 23:54:51 +02:00
time_internal.h
time.c
time.h
timecode.c
timecode.h
timer.h
timestamp.h lavu/timestamp: Avoid C++-unfriendly code in user header 2016-09-01 20:01:28 +01:00
tree.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
tree.h doc: fix spelling errors 2016-10-21 23:58:47 +02:00
twofish.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
twofish.h
utils.c avutil/avassert: Add av_assertX_fpu() 2016-10-22 13:50:09 +02:00
version.h avutil: Add av_image_check_size2() 2016-12-10 22:24:10 +01:00
wchar_filename.h
xga_font_data.c
xga_font_data.h
xtea.c Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13' 2016-05-11 19:13:03 +01:00
xtea.h