diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-11-28 23:23:22 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-12-02 16:11:50 +0100 |
commit | 0639f5c294c70c55f4da75ce2ca5bf6c5a809248 (patch) | |
tree | 53085f4c4add7758d9be4476dcb74ef978979ec1 /tools/dvd2concat | |
parent | 4e26520039ad7b45fc8d46fa7274e96cc0bdf8f9 (diff) | |
download | ffmpeg-0639f5c294c70c55f4da75ce2ca5bf6c5a809248.tar.gz |
avcodec/pthread_slice: Don't use static variable, fix race
ff_slice_thread_init() uses a static variable to hold a function
pointer, although the value of said pointer needn't be saved between
different runs of this function at all.
The reason for this being so is probably that said pointer points to
a static function (if used); but storage class specifiers like "static"
are not part of the type of an object and so including it in the pointer
declaration is wrong (anyway, "static" means different things in both
contexts: for the function declaration it affects linkage, for the
variable storage duration).
Using a static variable here can lead to races, e.g. when initializing
VP9 (for which said function pointer was added) and H.264 with slice
threading. The latter has the FF_CODEC_CAP_INIT_THREADSAFE flag set and
is therefore unaffected by the lock guarding initializations of
decoders.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'tools/dvd2concat')
0 files changed, 0 insertions, 0 deletions