Module: libav
Branch: release/0.8
Commit: 57c36de7265761dd94fb6bb4a9180011f796128f

Author:    Aaron Colwell <[email protected]>
Committer: Diego Biurrun <[email protected]>
Date:      Sun Mar 18 20:03:00 2012 -0700

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 <[email protected]>
(cherry picked from commit 30011bf20109eef1a0f9ee949b19f9998ad88663)
Signed-off-by: Diego Biurrun <[email protected]>

---

 libavcodec/vp8.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index a16f5ca..0b6d818 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;
 

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to