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
170170 }
171171
172172 /** 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;
174176 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;
176181 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;
178186 audio_size[i] = avio_rl32(pb) & 0xFFFF;
187+ }
179188
180189 /** build the sample index */
181190 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