提交 762ffa68 编写于 作者: L Laurent Aimar 提交者: Janne Grunau

segafilm: Fix potential division by 0 on corrupted streams in the demuxer

Signed-off-by: NJanne Grunau <janne-libav@jannau.net>
上级 790f4dd5
......@@ -113,11 +113,14 @@ static int film_read_header(AVFormatContext *s,
film->audio_bits = scratch[22];
if (scratch[23] == 2)
film->audio_type = CODEC_ID_ADPCM_ADX;
else if (film->audio_bits == 8)
film->audio_type = CODEC_ID_PCM_S8;
else if (film->audio_bits == 16)
film->audio_type = CODEC_ID_PCM_S16BE;
else
else if (film->audio_channels > 0) {
if (film->audio_bits == 8)
film->audio_type = CODEC_ID_PCM_S8;
else if (film->audio_bits == 16)
film->audio_type = CODEC_ID_PCM_S16BE;
else
film->audio_type = CODEC_ID_NONE;
} else
film->audio_type = CODEC_ID_NONE;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册