Files
ffmpeg/libavcodec
Andreas Rheinhardt 577ba4a1af avcodec/mpeg4videodec: Move use_intra_dc_vlc to stack, fix data race
use_intra_dc_vlc is currently kept in sync between frame threads
in mpeg4_update_thread_context(), yet it is set when decoding
blocks, i.e. after ff_thread_finish_setup(). This is a data race
and therefore undefined behaviour.

This race can be fixed easily by moving the variable from the context
to the stack: use_intra_dc_vlc is only read in
mpeg4_decode_block() and only if one is decoding an intra block.
There are three callsites for this function: One in
mpeg4_decode_partitioned_mb() which always sets use_intra_dc_vlc
before the call and two in mpeg4_decode_mb(). One of these callsites
is for intra blocks and use_intra_dc_vlc is set before it;
the last callsite is for non-intra blocks, where use_intra_dc_vlc
is ignored. So if it is used, it always uses a new value and can
therefore be moved to the stack.

The above also explains why this data race did not lead to
FATE-test failures.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 19:30:25 +01:00
..
2022-01-04 13:16:49 +01:00
2022-01-04 13:16:49 +01:00
2022-01-13 08:28:56 +01:00
2022-01-26 15:30:28 +01:00
2022-01-04 12:08:18 +01:00
2022-01-04 12:08:18 +01:00
2021-12-03 16:09:14 +01:00
2021-12-03 16:09:14 +01:00
2022-01-26 15:30:28 +01:00
2022-01-13 21:00:26 +01:00