[FFmpeg-devel] [PATCH 2/2] dnxhd: initialize DNXHDContext::avctx to each thread's respective one.

Paul B Mahol onemda at gmail.com
Thu Mar 30 00:16:25 EEST 2017


On 3/29/17, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> 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.
> ---
>  libavcodec/dnxhddec.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
> index 305fd52..766467e 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;
>
> --
> 2.8.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

ok


More information about the ffmpeg-devel mailing list