[FFmpeg-cvslog] segafilm: fix division by 0

Michael Niedermayer git at videolan.org
Sun Nov 11 18:56:54 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Nov 11 18:32:26 2012 +0100| [192db16b9c202e8d037c4820b11e125d8010e7bc] | committer: Michael Niedermayer

segafilm: fix division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=192db16b9c202e8d037c4820b11e125d8010e7bc
---

 libavformat/segafilm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c
index 1be2c5d..359d109 100644
--- a/libavformat/segafilm.c
+++ b/libavformat/segafilm.c
@@ -113,7 +113,7 @@ static int film_read_header(AVFormatContext *s)
         film->audio_samplerate = AV_RB16(&scratch[24]);
         film->audio_channels = scratch[21];
         film->audio_bits = scratch[22];
-        if (scratch[23] == 2)
+        if (scratch[23] == 2 && film->audio_channels > 0)
             film->audio_type = AV_CODEC_ID_ADPCM_ADX;
         else if (film->audio_channels > 0) {
             if (film->audio_bits == 8)



More information about the ffmpeg-cvslog mailing list