From 351c46b4dc3a1d63c148aaf611bf9bde3de34598 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Sat, 15 Mar 2025 05:30:15 +0100 Subject: [PATCH 19/77] avutil/slicethread: Remove NULL pointer check when freeing avpriv_slicethread_free() is one of our functions that takes a pointer to a pointer and resets the pointer when done. It is legal for such functions to be passed a pointer to a NULL pointer, yet passing a NULL pointer would be insane and should not be tolerated. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavutil/slicethread.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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--; -- 2.45.2