summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-07-06 23:54:49 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-09-01 00:41:28 +0200
commitc39b1d310afb6633a8af7c70c3976b44383bcb72 (patch)
treeab071d7b6a71a2c132adfc3ac7ebba2fd09d9485 /libavformat
parent04dabb241ba63c11b2863d237162985a797624d3 (diff)
downloadffmpeg-c39b1d310afb6633a8af7c70c3976b44383bcb72.tar.gz
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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 0a8a700acf..c6b9db5cb3 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);