[FFmpeg-cvslog] r15738 - trunk/libavformat/flvdec.c

cehoyos subversion
Wed Oct 29 00:49:05 CET 2008


Author: cehoyos
Date: Wed Oct 29 00:49:04 2008
New Revision: 15738

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


Modified:
   trunk/libavformat/flvdec.c

Modified: trunk/libavformat/flvdec.c
==============================================================================
--- trunk/libavformat/flvdec.c	(original)
+++ trunk/libavformat/flvdec.c	Wed Oct 29 00:49:04 2008
@@ -386,7 +386,7 @@ static int flv_read_packet(AVFormatConte
     }
 
     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;




More information about the ffmpeg-cvslog mailing list