History

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

Fixes: loop.cine

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

Commit 7e80b631 parent 7f9ec551 file · +5 −1Browse files

Unified · Split

libavformat/cinedec.c+5−1
@@ -267,8 +267,12 @@ static int cine_read_header(AVFormatContext *avctx) · 266 unmodified lines
267267
268268 /* parse image offsets */
269269 avio_seek(pb, offImageOffsets, SEEK_SET);
270− for (i = 0; i < st->duration; i++)
270+ for (i = 0; i < st->duration; i++) {
271+ if (avio_feof(pb))
272+ return AVERROR_INVALIDDATA;
273+
271274 av_add_index_entry(st, avio_rl64(pb), i, 0, 0, AVINDEX_KEYFRAME);
275+ }
272276
273277 return 0;
274278 }

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