summaryrefslogtreecommitdiff
path: root/libavcodec/dnxhddec.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2017-03-28 19:37:42 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2017-03-31 08:26:23 -0400
commitf800d6508d7e8fbd8d9777b775d333a4f02112ef (patch)
tree8695a03a898bcd20ca79d18eb5e02f8ff2ea95d0 /libavcodec/dnxhddec.c
parentef71dc7948322254d1f0fa41218b91f2da0279d9 (diff)
downloadffmpeg-f800d6508d7e8fbd8d9777b775d333a4f02112ef.tar.gz
dnxhd: initialize DNXHDContext::avctx to each thread's respective one.
Otherwise all thread's private contexts have the avctx pointer set to the AVCodecContext of the first thread, which means all writes to ctx->avctx->* (in e.g. read_header) are effectively race conditions. Fixes fate-dnxhd under tsan.
Diffstat (limited to 'libavcodec/dnxhddec.c')
-rw-r--r--libavcodec/dnxhddec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index f67763ef47..383e64ca9e 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -145,6 +145,7 @@ static av_cold int dnxhd_decode_init_thread_copy(AVCodecContext *avctx)
{
DNXHDContext *ctx = avctx->priv_data;
+ ctx->avctx = avctx;
// make sure VLC tables will be loaded when cid is parsed
ctx->cid = -1;