1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00

lavc/frame_thread_encoder: Do not memcpy() from NULL.

Fixes ticket #7981.
This commit is contained in:
Carl Eugen Hoyos 2019-07-02 11:42:32 +02:00
parent 690cab3232
commit e82a619c2a

View File

@ -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); int ret = av_opt_copy(thread_avctx->priv_data, avctx->priv_data);
if (ret < 0) if (ret < 0)
goto fail; goto fail;
} else } else if (avctx->codec->priv_data_size) {
memcpy(thread_avctx->priv_data, avctx->priv_data, avctx->codec->priv_data_size); memcpy(thread_avctx->priv_data, avctx->priv_data, avctx->codec->priv_data_size);
}
thread_avctx->thread_count = 1; thread_avctx->thread_count = 1;
thread_avctx->active_thread_type &= ~FF_THREAD_FRAME; thread_avctx->active_thread_type &= ~FF_THREAD_FRAME;