aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Colwell <acolwell@chromium.org>2012-03-18 20:03:00 -0700
committerDiego Biurrun <diego@biurrun.de>2014-08-19 06:15:26 -0700
commit57c36de7265761dd94fb6bb4a9180011f796128f (patch)
treed4863972dad1d499a07240469be18ae8bdc96462
parent8152b02f33a7b939cb2c9a5f26d10cd10465d4f9 (diff)
downloadffmpeg-57c36de7265761dd94fb6bb4a9180011f796128f.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> (cherry picked from commit 30011bf20109eef1a0f9ee949b19f9998ad88663) Signed-off-by: Diego Biurrun <diego@biurrun.de>
-rw-r--r--libavcodec/vp8.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index a16f5ca1ee..0b6d818e69 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -642,7 +642,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;