Fixes: out of array access Fixes: stack-buffer-overflow-READ-0x0831fff1
Showing the changes to libavformat (1 of 1 file). Show all
Unified · Split
| @@ -92,7 +92,7 @@ static int aa_read_header(AVFormatContext *s) · 91 unmodified lines | ||
| 92 | 92 | avio_skip(pb, 4); // magic string |
| 93 | 93 | toc_size = avio_rb32(pb); // TOC size |
| 94 | 94 | avio_skip(pb, 4); // unidentified integer |
| 95 | − if (toc_size > MAX_TOC_ENTRIES) | |
| 95 | + if (toc_size > MAX_TOC_ENTRIES || toc_size < 2) | |
| 96 | 96 | return AVERROR_INVALIDDATA; |
| 97 | 97 | for (i = 0; i < toc_size; i++) { // read TOC |
| 98 | 98 | avio_skip(pb, 4); // TOC entry index |