[FFmpeg-cvslog] vp8: avoid race condition on segment map.

Aaron Colwell git at videolan.org
Wed Mar 21 02:34:59 CET 2012


ffmpeg | branch: master | Aaron Colwell <acolwell at chromium.org> | Sun Mar 18 20:03:00 2012 -0700| [30011bf20109eef1a0f9ee949b19f9998ad88663] | committer: Ronald S. Bultje

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 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=30011bf20109eef1a0f9ee949b19f9998ad88663
---

 libavcodec/vp8.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index b5062e6..36518d5 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;
 



More information about the ffmpeg-cvslog mailing list