diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-07-07 00:54:49 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-10-09 22:33:00 +0300 |
commit | 1b8dbd0b37d5a4f7936fc091aa49faa0ed637951 (patch) | |
tree | 4ca230e95611a778fb01ae7d3be396f8eeb4fb89 /libavformat | |
parent | ea1761e14d46c1475696332c120e062f24851dc2 (diff) |
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@niedermayer.cc>
(cherry picked from commit b5de084aa63b79586bc445e6a7fea837688b3941)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/nutdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |