Browse Source

avformat/wavdec: check smv_frames_per_jpeg

Values outside would not be possible due to limitations of jpeg itself

Fixes very long running loop
Fixes Ticket2977

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.1
Michael Niedermayer 11 years ago
parent
commit
e024953722
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/wavdec.c

+ 4
- 0
libavformat/wavdec.c View File

@@ -369,6 +369,10 @@ static int wav_read_header(AVFormatContext *s)
avio_rl24(pb);
avio_rl24(pb);
wav->smv_frames_per_jpeg = avio_rl24(pb);
if (wav->smv_frames_per_jpeg > 65536) {
av_log(s, AV_LOG_ERROR, "too many frames per jpeg\n");
return AVERROR_INVALIDDATA;
}
AV_WL32(vst->codec->extradata, wav->smv_frames_per_jpeg);
wav->smv_cur_pt = 0;
goto break_loop;


Loading…
Cancel
Save