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

Michael Niedermayer git at videolan.org
Fri Apr 24 02:13:06 EEST 2020


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Fri Dec 13 00:38:29 2019 +0100| [51f6e2d7b8c7e423acbb4c527b05c9256d07632d] | 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>
(cherry picked from commit 1e23b5a706cd378ed07a200dfee656b38504f165)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 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 54d6d79b8b..93fc5ed650 100644
--- a/libavcodec/hevc_mp4toannexb_bsf.c
+++ b/libavcodec/hevc_mp4toannexb_bsf.c
@@ -180,7 +180,7 @@ static int hevc_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
         if (ret < 0)
             goto fail;
 
-        if (add_extradata)
+        if (extra_size)
             memcpy(out + out_size, ctx->spspps_buf, extra_size);
         AV_WB32(out + out_size + extra_size, 1);
         bytestream2_get_buffer(&gb, out + out_size + 4 + extra_size, nalu_size);



More information about the ffmpeg-cvslog mailing list