diff options
author | Aaron Colwell <acolwell@chromium.org> | 2012-03-18 20:03:00 -0700 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2012-03-19 13:49:34 -0700 |
commit | 30011bf20109eef1a0f9ee949b19f9998ad88663 (patch) | |
tree | 0203aeb1506b9283453c47dd84ea840dedd19258 /libavcodec | |
parent | 18ba94c6f9e08fc71cb5c4944bc6e4e1196e4634 (diff) | |
download | ffmpeg-30011bf20109eef1a0f9ee949b19f9998ad88663.tar.gz |
vp8: avoid race condition on segment map.
This change avoids accessing the segment map of the previous frame if
segmentation is not enabled for the current frame. The caller of
decode_mb_mode() only calls ff_thread_await_progress() on the reference
segmentation index array if segmentation is enabled, so Chromium's TSAN
will report a race when accessing this data while segmentation is not
enabled.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vp8.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index b5062e6696..36518d5f7e 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -641,7 +641,7 @@ void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, uint8_ if (s->segmentation.update_map) *segment = vp8_rac_get_tree(c, vp8_segmentid_tree, s->prob->segmentid); - else + else if (s->segmentation.enabled) *segment = ref ? *ref : *segment; s->segment = *segment; |