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.
This commit is contained in:
Ronald S. Bultje 2017-03-28 19:37:42 -04:00
parent ef71dc7948
commit f800d6508d

View File

@ -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;