mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
imc: Catch a division by zero
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
This commit is contained in:
parent
50cf5a7fb7
commit
bbf6a4aa20
@ -449,6 +449,10 @@ static int bit_allocation(IMCContext *q, IMCChannel *chctx,
|
||||
iacc += chctx->bandWidthT[i];
|
||||
summa += chctx->bandWidthT[i] * chctx->flcoeffs4[i];
|
||||
}
|
||||
|
||||
if (!iacc)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
chctx->bandWidthT[BANDS - 1] = 0;
|
||||
summa = (summa * 0.5 - freebits) / iacc;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user