imc: Catch a division by zero
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Reviewed-by: Kostya Shishkov Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
7d9cb12689
commit
87fb18c3e4
@ -450,6 +450,10 @@ static int bit_allocation(IMCContext *q, IMCChannel *chctx,
|
|||||||
iacc += chctx->bandWidthT[i];
|
iacc += chctx->bandWidthT[i];
|
||||||
summa += chctx->bandWidthT[i] * chctx->flcoeffs4[i];
|
summa += chctx->bandWidthT[i] * chctx->flcoeffs4[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!iacc)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
chctx->bandWidthT[BANDS - 1] = 0;
|
chctx->bandWidthT[BANDS - 1] = 0;
|
||||||
summa = (summa * 0.5 - freebits) / iacc;
|
summa = (summa * 0.5 - freebits) / iacc;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user