[FFmpeg-cvslog] lavc/frame_thread_encoder: Do not memcpy() from NULL.

Carl Eugen Hoyos git at videolan.org
Sun Aug 11 01:04:21 EEST 2019


ffmpeg | branch: master | Carl Eugen Hoyos <ceffmpeg at gmail.com> | Tue Jul  2 11:42:32 2019 +0200| [e82a619c2a154ae6e3e3a81af55977bd5a46660e] | committer: Carl Eugen Hoyos

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

Fixes ticket #7981.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e82a619c2a154ae6e3e3a81af55977bd5a46660e
---

 libavcodec/frame_thread_encoder.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c
index 55756c4c54..949bc69f81 100644
--- a/libavcodec/frame_thread_encoder.c
+++ b/libavcodec/frame_thread_encoder.c
@@ -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->codec->priv_data_size) {
             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;
 



More information about the ffmpeg-cvslog mailing list