diff --git a/libavutil/slicethread.c b/libavutil/slicethread.c index e6b82e31b6..6593d58abc 100644 --- a/libavutil/slicethread.c +++ b/libavutil/slicethread.c @@ -224,13 +224,12 @@ void avpriv_slicethread_execute(AVSliceThread *ctx, int nb_jobs, int execute_mai void avpriv_slicethread_free(AVSliceThread **pctx) { - AVSliceThread *ctx; + AVSliceThread *ctx = *pctx; int nb_workers, i; - if (!pctx || !*pctx) + if (!ctx) return; - ctx = *pctx; nb_workers = ctx->nb_threads; if (!ctx->main_func) nb_workers--;