History

avformat/mxfdec: check index entry array size

Marton Balint committed 3 years ago

Commit 6aff3c51 parent 75721851 file · +5 −1Browse files

Unified · Split

libavformat/mxfdec.c+5−1
@@ -1198,11 +1198,15 @@ static int mxf_read_essence_container_data(void *arg, AVIOContext *pb, int tag, · 1197 unmodified lines
11981198 static int mxf_read_index_entry_array(AVIOContext *pb, MXFIndexTableSegment *segment)
11991199 {
12001200 int i, length;
1201+ uint32_t nb_index_entries;
12011202
12021203 if (segment->temporal_offset_entries)
12031204 return AVERROR_INVALIDDATA;
12041205
1205− segment->nb_index_entries = avio_rb32(pb);
1206+ nb_index_entries = avio_rb32(pb);
1207+ if (nb_index_entries > INT_MAX)
1208+ return AVERROR_INVALIDDATA;
1209+ segment->nb_index_entries = nb_index_entries;
12061210
12071211 length = avio_rb32(pb);
12081212 if(segment->nb_index_entries && length < 11)

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