Commit 37309e02 authored by cehoyos's avatar cehoyos

Fix endless loop when opening corrupt FLV files (issue 699).


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15738 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 66796dd4
......@@ -386,7 +386,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
}
if(is_audio){
if(!st->codec->sample_rate || !st->codec->bits_per_coded_sample || (!st->codec->codec_id && !st->codec->codec_tag)) {
if(!st->codec->channels || !st->codec->sample_rate || !st->codec->bits_per_coded_sample || (!st->codec->codec_id && !st->codec->codec_tag)) {
st->codec->channels = (flags & FLV_AUDIO_CHANNEL_MASK) == FLV_STEREO ? 2 : 1;
st->codec->sample_rate = (44100 << ((flags & FLV_AUDIO_SAMPLERATE_MASK) >> FLV_AUDIO_SAMPLERATE_OFFSET) >> 3);
st->codec->bits_per_coded_sample = (flags & FLV_AUDIO_SAMPLESIZE_MASK) ? 16 : 8;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment