mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-10 00:30:14 +00:00
tta: error out if samplerate is zero.
Prevents a division by zero later on.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 7416d61036
)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
d19e3e19d6
commit
7046ae5593
@ -224,6 +224,9 @@ static av_cold int tta_decode_init(AVCodecContext * avctx)
|
||||
if (s->channels == 0) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Invalid number of channels\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
} else if (avctx->sample_rate == 0) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Invalid samplerate\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
switch(s->bps) {
|
||||
|
Loading…
Reference in New Issue
Block a user