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 | avio_skip(pb, 4); // magic string | 92 | avio_skip(pb, 4); // magic string |
| 93 | toc_size = avio_rb32(pb); // TOC size | 93 | toc_size = avio_rb32(pb); // TOC size |
| 94 | avio_skip(pb, 4); // unidentified integer | 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 | return AVERROR_INVALIDDATA; | 96 | return AVERROR_INVALIDDATA; |
| 97 | for (i = 0; i < toc_size; i++) { // read TOC | 97 | for (i = 0; i < toc_size; i++) { // read TOC |
| 98 | avio_skip(pb, 4); // TOC entry index | 98 | avio_skip(pb, 4); // TOC entry index |