diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-01-26 21:29:42 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-01-29 19:30:25 +0100 |
commit | 577ba4a1af08f47d1a2f0d175092f770a1d897c8 (patch) | |
tree | 47968148b3a89d3efcd75b466df0155e7e02452d /tests/fate/seek.mak | |
parent | 24a654c6c96310b1b408a6d053ad52de41640e5e (diff) | |
download | ffmpeg-577ba4a1af08f47d1a2f0d175092f770a1d897c8.tar.gz |
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>
Diffstat (limited to 'tests/fate/seek.mak')
0 files changed, 0 insertions, 0 deletions