Fix DoS due to lack of eof check
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 2m22s
Build system / Build (pull_request) Successful in 36m9s

This commit is contained in:
2025-12-19 09:47:21 +08:00
parent 7b0867a6cf
commit f1b4023d99

View File

@@ -306,6 +306,8 @@ static int mv_read_header(AVFormatContext *avctx)
uint32_t pos = avio_rb32(pb);
uint32_t asize = avio_rb32(pb);
uint32_t vsize = avio_rb32(pb);
if (avio_feof(pb))
return AVERROR_INVALIDDATA;
avio_skip(pb, 8);
av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME);
av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME);