diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-10-01 18:17:42 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-10-09 13:20:39 +0200 |
commit | 5a261cfa32d2833d20d87414bef267f3765abc4d (patch) | |
tree | b6382499822d50615ca3a523c373c657523f09d1 /libavfilter/convolution.h | |
parent | 98aec8c1b864e44636c0fabdaff3494d2051fda3 (diff) | |
download | ffmpeg-5a261cfa32d2833d20d87414bef267f3765abc4d.tar.gz |
avformat/allformats: Fix data race when accessing devices lists
Up until now setting the input and output devices lists is guarded
by a mutex. This prevents data races emanating from multiple concurrent
calls to avpriv_register_devices() (triggered by multiple concurrent
calls to avdevice_register_all()). Yet reading the lists pointers was
done without any lock and with nonatomic variables. This means that
there are data races in case of concurrent calls to
av_(de)muxer_iterate() and avdevice_register_all() (but only if the
iteration in av_(de)muxer_iterate exhausts the non-device (de)muxers).
This commit fixes this by putting said pointers into atomic objects.
Due to the unavailability of _Atomic the object is an atomic_uintptr,
leading to ugly casts. Switching to atomics also allowed to remove
the mutex currently used in avpriv_register_devices().
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/convolution.h')
0 files changed, 0 insertions, 0 deletions