Browse Source

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>
(cherry picked from commit 7e80b63ecd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3.4
孙浩 and 张洪亮(望初) Michael Niedermayer 7 years ago
parent
commit
4ff1fcd3ca
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      libavformat/cinedec.c

+ 5
- 1
libavformat/cinedec.c View File

@@ -267,8 +267,12 @@ static int cine_read_header(AVFormatContext *avctx)


/* parse image offsets */ /* parse image offsets */
avio_seek(pb, offImageOffsets, SEEK_SET); 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); av_add_index_entry(st, avio_rl64(pb), i, 0, 0, AVINDEX_KEYFRAME);
}


return 0; return 0;
} }


Loading…
Cancel
Save