1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

ttadec: check channel count as read from extradata.

fixes floating-point exception due to channels being set to 0.
fixes Bug 128.

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
This commit is contained in:
Shitiz Garg 2011-12-11 01:10:57 +05:30 committed by Justin Ruggles
parent 7d18d17abd
commit 8bd1f1a4c8

View File

@ -221,6 +221,11 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
s->data_length = get_bits_long(&s->gb, 32);
skip_bits(&s->gb, 32); // CRC32 of header
if (s->channels == 0) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid number of channels\n");
return AVERROR_INVALIDDATA;
}
switch(s->bps) {
case 2:
avctx->sample_fmt = AV_SAMPLE_FMT_S16;