[FFmpeg-cvslog] avformat/mm: Check length

Michael Niedermayer git at videolan.org
Wed Jul 24 17:50:42 EEST 2024


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Thu Jul 11 19:29:14 2024 +0200| [000b9de913478eef9a2effa8969d575ce33cac6e] | committer: Michael Niedermayer

avformat/mm: Check length

Fixes: CID1220824 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 139bf412464e62a83984cd49093936dcaa7a0865)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=000b9de913478eef9a2effa8969d575ce33cac6e
---

 libavformat/mm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mm.c b/libavformat/mm.c
index 02ffbcd824..097c3efc1c 100644
--- a/libavformat/mm.c
+++ b/libavformat/mm.c
@@ -94,7 +94,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 */



More information about the ffmpeg-cvslog mailing list