Forgotten in 28e9ba951d1a0b0aca53b242aa64f484ca75e874.
Fixes #7241.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
... | ... |
@@ -1369,8 +1369,10 @@ static av_cold int dnxhd_encode_end(AVCodecContext *avctx) |
1369 | 1369 |
av_freep(&ctx->qmatrix_c16); |
1370 | 1370 |
av_freep(&ctx->qmatrix_l16); |
1371 | 1371 |
|
1372 |
- for (i = 1; i < avctx->thread_count; i++) |
|
1373 |
- av_freep(&ctx->thread[i]); |
|
1372 |
+ if (avctx->active_thread_type == FF_THREAD_SLICE) { |
|
1373 |
+ for (i = 1; i < avctx->thread_count; i++) |
|
1374 |
+ av_freep(&ctx->thread[i]); |
|
1375 |
+ } |
|
1374 | 1376 |
|
1375 | 1377 |
return 0; |
1376 | 1378 |
} |