diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-07-07 00:54:49 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-09-26 17:50:50 +0300 |
commit | b60d9730cf99653215acd42dc7d3b7ae17655ab9 (patch) | |
tree | 0c5b41d65d8cc1690dc94128c3637f57b74cb732 | |
parent | a17ba6b3cedeb53b7af488c82d2e81ce40fe7b21 (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>
-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 3b747a02bf..abe4fa2b93 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); |