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>
pull/37/merge
Michael Niedermayer 11 years ago
parent cd05c4060a
commit e024953722
  1. 4
      libavformat/wavdec.c

@ -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