History

avformat/aadec: Check toc_size to contain the minimum to demuxer uses

Fixes: out of array access Fixes: stack-buffer-overflow-READ-0x0831fff1

Michael Niedermayer committed 6 years ago

Commit daa24821 parent 435fa371 file · +1 −1Browse files

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/aadec.c+1−1
@@ -92,7 +92,7 @@ static int aa_read_header(AVFormatContext *s) · 91 unmodified lines
92 avio_skip(pb, 4); // magic string92 avio_skip(pb, 4); // magic string
93 toc_size = avio_rb32(pb); // TOC size93 toc_size = avio_rb32(pb); // TOC size
94 avio_skip(pb, 4); // unidentified integer94 avio_skip(pb, 4); // unidentified integer
95 if (toc_size > MAX_TOC_ENTRIES)95 if (toc_size > MAX_TOC_ENTRIES || toc_size < 2)
96 return AVERROR_INVALIDDATA;96 return AVERROR_INVALIDDATA;
97 for (i = 0; i < toc_size; i++) { // read TOC97 for (i = 0; i < toc_size; i++) { // read TOC
98 avio_skip(pb, 4); // TOC entry index98 avio_skip(pb, 4); // TOC entry index

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t