History

avformat/rl2: Fix DoS due to lack of eof check

Fixes: loop.rl2

孙浩 and 张洪亮(望初) committed 9 years ago

Commit 96f24d11 parent 124eb201 file · +12 −3Browse files

Unified · Split

libavformat/rl2.c+12−3
@@ -170,12 +170,21 @@ static av_cold int rl2_read_header(AVFormatContext *s) · 169 unmodified lines
170 }170 }
171 171
172 /** read offset and size tables */172 /** read offset and size tables */
173 for(i=0; i < frame_count;i++)173 for(i=0; i < frame_count;i++) {
174 if (avio_feof(pb))
175 return AVERROR_INVALIDDATA;
174 chunk_size[i] = avio_rl32(pb);176 chunk_size[i] = avio_rl32(pb);
175 for(i=0; i < frame_count;i++)177 }
178 for(i=0; i < frame_count;i++) {
179 if (avio_feof(pb))
180 return AVERROR_INVALIDDATA;
176 chunk_offset[i] = avio_rl32(pb);181 chunk_offset[i] = avio_rl32(pb);
177 for(i=0; i < frame_count;i++)182 }
183 for(i=0; i < frame_count;i++) {
184 if (avio_feof(pb))
185 return AVERROR_INVALIDDATA;
178 audio_size[i] = avio_rl32(pb) & 0xFFFF;186 audio_size[i] = avio_rl32(pb) & 0xFFFF;
187 }
179 188
180 /** build the sample index */189 /** build the sample index */
181 for(i=0;i<frame_count;i++){190 for(i=0;i<frame_count;i++){

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