diff mbox series

[FFmpeg-devel,06/22] avformat/mm: Check length

Message ID 20240711233417.1896879-6-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,01/22] avformat/asfdec_o: Check size of index object | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer July 11, 2024, 11:34 p.m. UTC
Fixes: CID1220824 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/mm.c b/libavformat/mm.c
index 23c025d8525..e377ed4fbb9 100644
--- a/libavformat/mm.c
+++ b/libavformat/mm.c
@@ -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 */