From d72fe544d6d7cdf816a75df858b17f1744049d97 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Mon, 1 Jul 2019 00:49:44 +0200
Subject: [PATCH] lavc/frame_thread_encoder: Do not memcpy() from NULL.
Fixes ticket #7981.
---
libavcodec/frame_thread_encoder.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -209,8 +209,9 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
int ret = av_opt_copy(thread_avctx->priv_data, avctx->priv_data);
if (ret < 0)
goto fail;
- } else
+ } else if (avctx->priv_data) {
memcpy(thread_avctx->priv_data, avctx->priv_data, avctx->codec->priv_data_size);
+ }
thread_avctx->thread_count = 1;
thread_avctx->active_thread_type &= ~FF_THREAD_FRAME;
--
2.22.0