diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-04-07 12:04:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-07-01 12:49:26 +0200 |
commit | d7e9a720609c0e2be6c73fcd8401b3600f605b74 (patch) | |
tree | dd09709fd1fd4e521b39d8d5c76a19625a2e9c31 | |
parent | e26d6f68bb54f948d311ad037e040edd80190cc7 (diff) | |
download | ffmpeg-d7e9a720609c0e2be6c73fcd8401b3600f605b74.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>
-rw-r--r-- | libavformat/aadec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/aadec.c b/libavformat/aadec.c index fc5363d51d..ddaf5aeb9a 100644 --- a/libavformat/aadec.c +++ b/libavformat/aadec.c @@ -85,7 +85,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 |