[FFmpeg-cvslog] avformat/asfdec_o: Check size of index object

Michael Niedermayer git at videolan.org
Sun Jan 5 01:28:47 EET 2025


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Thu Jul 11 17:38:08 2024 +0200| [d8d3395c17f4f239999e145eb4d85ea94caa5f7b] | committer: Michael Niedermayer

avformat/asfdec_o: Check size of index object

We subtract 24 so it must be at least 24

Fixes: CID1604482 Overflowed constant

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

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

 libavformat/asfdec_o.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index a17c953f06..107ec7a315 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -985,6 +985,9 @@ static int asf_read_simple_index(AVFormatContext *s, const GUIDParseTable *g)
     int i, ret;
     uint64_t size = avio_rl64(pb);
 
+    if (size < 24)
+        return AVERROR_INVALIDDATA;
+
     // simple index objects should be ordered by stream number, this loop tries to find
     // the first not indexed video stream
     for (i = 0; i < asf->nb_streams; i++) {



More information about the ffmpeg-cvslog mailing list