[FFmpeg-cvslog] avcodec/hevc_mp4toannexb_bsf: Avoid NULL memcpy()

Michael Niedermayer git at videolan.org
Sat Jan 18 19:59:56 EET 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Dec 13 00:38:29 2019 +0100| [1e23b5a706cd378ed07a200dfee656b38504f165] | committer: Michael Niedermayer

avcodec/hevc_mp4toannexb_bsf: Avoid NULL memcpy()

Fixes: invalid memcpy use
Fixes: 19299/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_MP4TOANNEXB_fuzzer-5169193398042624

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/hevc_mp4toannexb_bsf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hevc_mp4toannexb_bsf.c b/libavcodec/hevc_mp4toannexb_bsf.c
index 09bce5b34c..d0f1b94f0e 100644
--- a/libavcodec/hevc_mp4toannexb_bsf.c
+++ b/libavcodec/hevc_mp4toannexb_bsf.c
@@ -164,7 +164,7 @@ static int hevc_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *out)
         if (ret < 0)
             goto fail;
 
-        if (add_extradata)
+        if (extra_size)
             memcpy(out->data + prev_size, ctx->par_out->extradata, extra_size);
         AV_WB32(out->data + prev_size + extra_size, 1);
         bytestream2_get_buffer(&gb, out->data + prev_size + 4 + extra_size, nalu_size);



More information about the ffmpeg-cvslog mailing list