Module: libav Branch: release/9 Commit: 6d2a92c4678616fe342be0b606343ae3ade83641
Author: Luca Barbato <lu_z...@gentoo.org> Committer: Luca Barbato <lu_z...@gentoo.org> Date: Tue Jul 9 09:18:16 2013 +0200 imc: Catch a division by zero Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-sta...@libav.org (cherry picked from commit bbf6a4aa20bfe3d7869b2218e66063602dfb8aa7) Signed-off-by: Luca Barbato <lu_z...@gentoo.org> --- libavcodec/imc.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/libavcodec/imc.c b/libavcodec/imc.c index 5cff70f..316dd77 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -450,6 +450,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; _______________________________________________ libav-commits mailing list libav-commits@libav.org https://lists.libav.org/mailman/listinfo/libav-commits