Skip to content

Commit 7e80b63

Browse files
孙浩 and 张洪亮(望初)michaelni
孙浩 and 张洪亮(望初)
authored andcommitted
avformat/cinedec: Fix DoS due to lack of eof check
Fixes: loop.cine Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
1 parent 7f9ec55 commit 7e80b63

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: libavformat/cinedec.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,12 @@ static int cine_read_header(AVFormatContext *avctx)
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
}

0 commit comments

Comments
 (0)