aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Wason <rectalogic@rectalogic.com>2008-10-28 23:49:04 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2008-10-28 23:49:04 +0000
commit8ff8de73a4853a1f00baab707021bde7988f97bb (patch)
tree4aa7032c512bb6bf617017650d5ec0b0f81e8cb7
parent2be3fe39bf09eb25f98def140d274dc825ca7cfe (diff)
downloadffmpeg-8ff8de73a4853a1f00baab707021bde7988f97bb.tar.gz
Fix endless loop when opening corrupt FLV files (issue 699).
Patch by Andrew Wason, rectalogic A rectalogic D com Originally committed as revision 15738 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/flvdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 08008836fa..0b25a25e96 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -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;