diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-10-06 20:58:06 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-10-10 14:27:22 +0200 |
commit | aac8fa2fbfe235f4a6c3ea733295dd59a7bae8f7 (patch) | |
tree | bd52309570023b9b5fa07327903c4ec52c332338 /libavdevice/decklink_common.cpp | |
parent | 18ddb25c7a58404641de2f6aa68220bd509e376c (diff) | |
download | ffmpeg-aac8fa2fbfe235f4a6c3ea733295dd59a7bae8f7.tar.gz |
avfilter/asrc_flite: Fix races upon (un)registering voices
The voice registration system in libflite is broken: It is not
thread-safe and also not based on internal counters; instead
any call to unregister a voice frees said voice even if there are still
many other users of said voice who have also registered said voice.
While there is no way to guard against another library unregistering
voices behind our back, we can at least be correct in the absence of
other users of libflite. The current code already tried this by using
a reference count of our own for each voice; but the implementation
of this is not thread-safe at all.
Fix this by using a mutex to guard all of libavfilter's libflite
registration and unregistration calls, thereby being thread-safe
in the absence of other libflite users.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavdevice/decklink_common.cpp')
0 files changed, 0 insertions, 0 deletions