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
9292 avio_skip(pb, 4); // magic string
9393 toc_size = avio_rb32(pb); // TOC size
9494 avio_skip(pb, 4); // unidentified integer
95− if (toc_size > MAX_TOC_ENTRIES)
95+ if (toc_size > MAX_TOC_ENTRIES || toc_size < 2)
9696 return AVERROR_INVALIDDATA;
9797 for (i = 0; i < toc_size; i++) { // read TOC
9898 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