[FFmpeg-cvslog] avformat/nutdec: Check get_packetheader() in mainheader

Michael Niedermayer git at videolan.org
Sun Oct 9 23:06:55 EEST 2022


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Wed Jul  6 23:54:49 2022 +0200| [1b8dbd0b37d5a4f7936fc091aa49faa0ed637951] | committer: Michael Niedermayer

avformat/nutdec: Check get_packetheader() in mainheader

Fixes; Timeout
Fixes: 48794/clusterfuzz-testcase-minimized-ffmpeg_dem_NUT_fuzzer-6524604713140224

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 b5de084aa63b79586bc445e6a7fea837688b3941)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/nutdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index cc1e6b6fbe..855214a451 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -199,6 +199,8 @@ static int decode_main_header(NUTContext *nut)
     int tmp_stream, tmp_mul, tmp_pts, tmp_size, tmp_res, tmp_head_idx;
 
     length = get_packetheader(nut, bc, 1, MAIN_STARTCODE);
+    if (length == (uint64_t)-1)
+        return AVERROR_INVALIDDATA;
     end = length + avio_tell(bc);
 
     nut->version = ffio_read_varlen(bc);



More information about the ffmpeg-cvslog mailing list