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.
Unified · Split
| @@ -224,13 +224,12 @@ void avpriv_slicethread_execute(AVSliceThread *ctx, int nb_jobs, int execute_mai · 223 unmodified lines | |||
| 224 | 224 | ||
| 225 | void avpriv_slicethread_free(AVSliceThread **pctx) | 225 | void avpriv_slicethread_free(AVSliceThread **pctx) |
| 226 | { | 226 | { |
| 227 | AVSliceThread *ctx; | 227 | AVSliceThread *ctx = *pctx; |
| 228 | int nb_workers, i; | 228 | int nb_workers, i; |
| 229 | 229 | ||
| 230 | if (!pctx || !*pctx) | 230 | if (!ctx) |
| 231 | return; | 231 | return; |
| 232 | 232 | ||
| 233 | ctx = *pctx; | ||
| 234 | nb_workers = ctx->nb_threads; | 233 | nb_workers = ctx->nb_threads; |
| 235 | if (!ctx->main_func) | 234 | if (!ctx->main_func) |
| 236 | nb_workers--; | 235 | nb_workers--; |