Browse Source

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

Fixes: loop.mv

Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.4
Michael Niedermayer 8 years ago
parent
commit
4f05e2e2dc
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavformat/mvdec.c

+ 2
- 0
libavformat/mvdec.c View File

@@ -342,6 +342,8 @@ static int mv_read_header(AVFormatContext *avctx)
uint32_t pos = avio_rb32(pb); uint32_t pos = avio_rb32(pb);
uint32_t asize = avio_rb32(pb); uint32_t asize = avio_rb32(pb);
uint32_t vsize = avio_rb32(pb); uint32_t vsize = avio_rb32(pb);
if (avio_feof(pb))
return AVERROR_INVALIDDATA;
avio_skip(pb, 8); avio_skip(pb, 8);
av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME); av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME);
av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME); av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME);


Loading…
Cancel
Save