changeset 4013:ca3996178741 libavformat

Fix endless loop when opening corrupt FLV files (issue 699). Patch by Andrew Wason, rectalogic A rectalogic D com
author cehoyos
date Tue, 28 Oct 2008 23:49:04 +0000
parents 2040c6c46c3c
children 2e7994e45100
files flvdec.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flvdec.c	Mon Oct 27 00:21:42 2008 +0000
+++ b/flvdec.c	Tue Oct 28 23:49:04 2008 +0000
@@ -386,7 +386,7 @@
     }
 
     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;