[FFmpeg-cvslog] avcodec/cbs_jpeg: Fix uninitialized end index in cbs_jpeg_split_fragment()

Michael Niedermayer git at videolan.org
Fri Jul 10 21:28:05 EEST 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Jul 10 19:37:57 2020 +0200| [4a10bc8f6f5d600c44ecb9b43cd9abf13bf3bfae] | committer: Michael Niedermayer

avcodec/cbs_jpeg: Fix uninitialized end index in cbs_jpeg_split_fragment()

Fixes: Out of array read
Fixes: 24043/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5084566275751936.fuzz

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=4a10bc8f6f5d600c44ecb9b43cd9abf13bf3bfae
---

 libavcodec/cbs_jpeg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/cbs_jpeg.c b/libavcodec/cbs_jpeg.c
index 09329434e4..7d3e10fcc8 100644
--- a/libavcodec/cbs_jpeg.c
+++ b/libavcodec/cbs_jpeg.c
@@ -149,6 +149,7 @@ static int cbs_jpeg_split_fragment(CodedBitstreamContext *ctx,
             break;
         } else if (marker == JPEG_MARKER_SOS) {
             next_marker = -1;
+            end = start;
             for (i = start; i + 1 < frag->data_size; i++) {
                 if (frag->data[i] != 0xff)
                     continue;



More information about the ffmpeg-cvslog mailing list