1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avformat/mm: Check length

Fixes: CID1220824 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-07-11 19:29:14 +02:00
parent 291356f58b
commit 139bf41246
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -95,7 +95,7 @@ static int read_header(AVFormatContext *s)
type = avio_rl16(pb);
length = avio_rl32(pb);
if (type != MM_TYPE_HEADER)
if (type != MM_TYPE_HEADER || length < 10)
return AVERROR_INVALIDDATA;
/* read header */