1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-19 05:49:09 +02:00
FFmpeg/libavformat
Andreas Rheinhardt 5a261cfa32 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>
2021-10-09 13:20:39 +02:00
..
2021-09-19 20:12:32 +02:00
2021-09-26 08:51:58 +02:00
2021-10-03 20:56:12 +02:00
2021-10-03 20:56:12 +02:00
2021-09-07 18:07:11 +10:00
2021-09-24 00:14:01 +02:00
2021-09-19 04:40:13 +02:00
2021-10-07 11:52:10 +02:00
2021-10-03 20:56:12 +02:00
2021-10-03 20:56:12 +02:00
2021-10-09 11:42:16 +02:00