mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-25 04:30:02 +00:00
twinvq: validate that channels is not <= 0
This could occur due to integer overflow when reading the channel count from the extradata.
This commit is contained in:
parent
cebea00c8a
commit
8cc72ce5a0
@ -1126,7 +1126,7 @@ static av_cold int twin_decode_init(AVCodecContext *avctx)
|
||||
default: avctx->sample_rate = isampf * 1000; break;
|
||||
}
|
||||
|
||||
if (avctx->channels > CHANNELS_MAX) {
|
||||
if (avctx->channels <= 0 || avctx->channels > CHANNELS_MAX) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %i\n",
|
||||
avctx->channels);
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user