Skip to content
Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
孙浩 and 张洪亮(望初) authored and michaelni committed Aug 27, 2017
1 parent 7f9ec55 commit 7e80b63
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libavformat/cinedec.c
Expand Up @@ -267,8 +267,12 @@ static int cine_read_header(AVFormatContext *avctx)

/* parse image offsets */
avio_seek(pb, offImageOffsets, SEEK_SET);
for (i = 0; i < st->duration; i++)
for (i = 0; i < st->duration; i++) {
if (avio_feof(pb))
return AVERROR_INVALIDDATA;

av_add_index_entry(st, avio_rl64(pb), i, 0, 0, AVINDEX_KEYFRAME);
}

return 0;
}
Expand Down

1 comment on commit 7e80b63

@shqking
Copy link

@shqking shqking commented on 7e80b63 Sep 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.