summaryrefslogtreecommitdiff
path: root/libavcodec/dnxhdenc.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2018-06-01 10:54:39 +0200
committerPaul B Mahol <onemda@gmail.com>2018-06-01 10:54:39 +0200
commit0d35413e5dbe304bafbe48b1057785ced44de71f (patch)
tree38cd2c2c63cd0a0a5acbe6c9ddda5395efd17ec5 /libavcodec/dnxhdenc.c
parent04b570817b2b38e35675b17328239746212f4c3f (diff)
downloadffmpeg-0d35413e5dbe304bafbe48b1057785ced44de71f.tar.gz
avcodec/dnxhdenc: do not free nonexistent slice threads data when frame threading is used
Forgotten in 28e9ba951d1a0b0aca53b242aa64f484ca75e874. Fixes #7241. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/dnxhdenc.c')
-rw-r--r--libavcodec/dnxhdenc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 86e71ca8b0..01e22e7764 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -1369,8 +1369,10 @@ static av_cold int dnxhd_encode_end(AVCodecContext *avctx)
av_freep(&ctx->qmatrix_c16);
av_freep(&ctx->qmatrix_l16);
- for (i = 1; i < avctx->thread_count; i++)
- av_freep(&ctx->thread[i]);
+ if (avctx->active_thread_type == FF_THREAD_SLICE) {
+ for (i = 1; i < avctx->thread_count; i++)
+ av_freep(&ctx->thread[i]);
+ }
return 0;
}