aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/aadec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-04-07 12:04:25 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-02 19:55:09 +0200
commit42d2468ce4d3e711bf8dc0944eb1f70b767a0d9e (patch)
treeb2532c8a8ecd27aef31028a053f1103cbae5c968 /libavformat/aadec.c
parentc9672ca36330751f6c7455965d61634a94328fe0 (diff)
downloadffmpeg-42d2468ce4d3e711bf8dc0944eb1f70b767a0d9e.tar.gz
avformat/aadec: Check toc_size to contain the minimum to demuxer uses
Fixes: out of array access Fixes: stack-buffer-overflow-READ-0x0831fff1 Found-by: GalyCannon <galycannon@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit daa2482871dffa9af12fa6d874a3d2dedd73f42e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/aadec.c')
-rw-r--r--libavformat/aadec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/aadec.c b/libavformat/aadec.c
index fe7a99f827..7327f0df68 100644
--- a/libavformat/aadec.c
+++ b/libavformat/aadec.c
@@ -86,7 +86,7 @@ static int aa_read_header(AVFormatContext *s)
avio_skip(pb, 4); // magic string
toc_size = avio_rb32(pb); // TOC size
avio_skip(pb, 4); // unidentified integer
- if (toc_size > MAX_TOC_ENTRIES)
+ if (toc_size > MAX_TOC_ENTRIES || toc_size < 2)
return AVERROR_INVALIDDATA;
for (i = 0; i < toc_size; i++) { // read TOC
avio_skip(pb, 4); // TOC entry index