aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <clement.boesch@smartjog.com>2012-10-03 15:14:40 +0200
committerClément Bœsch <ubitux@gmail.com>2012-10-03 15:38:22 +0200
commit1e2e2c8095de2d9ea3259305cfeff28f40e4ca12 (patch)
treeef6c16b3e8c8abf93b7b0a7f9f359bcd016bacad
parent7e5496fc41810825657e0a21fb5dcc3081ca1c5a (diff)
downloadffmpeg-1e2e2c8095de2d9ea3259305cfeff28f40e4ca12.tar.gz
lavc/h264: move ff_init_cabac_states() from decode_slice() to ff_h264_decode_init().
This fixes one of the potential races spotted by Helgrind.
-rw-r--r--libavcodec/h264.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 9c79f35189..9a2d9d7583 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1112,6 +1112,8 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
s->low_delay = 0;
}
+ ff_init_cabac_states();
+
return 0;
}
@@ -3533,7 +3535,6 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
align_get_bits(&s->gb);
/* init cabac */
- ff_init_cabac_states();
ff_init_cabac_decoder(&h->cabac,
s->gb.buffer + get_bits_count(&s->gb) / 8,
(get_bits_left(&s->gb) + 7) / 8);