aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-07-11 17:38:08 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-07-21 16:40:48 +0200
commit891bc070f0294e564a02f9a71f6591b6a62c90cc (patch)
tree2d83cae9189c433cef5ffb14661169f6ed6d1b00
parent2a8fb3c2cc07e741bca556eee8aea704fda4c33f (diff)
downloadffmpeg-891bc070f0294e564a02f9a71f6591b6a62c90cc.tar.gz
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@niedermayer.cc>
-rw-r--r--libavformat/asfdec_o.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c
index dfe448e9f7..dd187e600d 100644
--- a/libavformat/asfdec_o.c
+++ b/libavformat/asfdec_o.c
@@ -867,6 +867,9 @@ static int asf_read_simple_index(AVFormatContext *s, const GUIDParseTable *g)
int64_t offset;
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++) {