History

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.

Andreas Rheinhardt committed 1 year ago

Commit f9fe1e01 parent 7d1bf0a1 file · +2 −3Browse files

Unified · Split

libavutil/slicethread.c+2−3
@@ -224,13 +224,12 @@ void avpriv_slicethread_execute(AVSliceThread *ctx, int nb_jobs, int execute_mai · 223 unmodified lines
224224
225225 void avpriv_slicethread_free(AVSliceThread **pctx)
226226 {
227− AVSliceThread *ctx;
227+ AVSliceThread *ctx = *pctx;
228228 int nb_workers, i;
229229
230− if (!pctx || !*pctx)
230+ if (!ctx)
231231 return;
232232
233− ctx = *pctx;
234233 nb_workers = ctx->nb_threads;
235234 if (!ctx->main_func)
236235 nb_workers--;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t