OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7d9cb12
)
imc: Catch a division by zero
author
Luca Barbato
<lu_zero@gentoo.org>
Tue, 9 Jul 2013 07:19:30 +0000
(09:19 +0200)
committer
Michael Niedermayer
<michaelni@gmx.at>
Tue, 9 Jul 2013 14:20:50 +0000
(16:20 +0200)
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Kostya Shishkov
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/imc.c
patch
|
blob
|
history
diff --git
a/libavcodec/imc.c
b/libavcodec/imc.c
index
eb7c255
..
deec0a1
100644
(file)
--- 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;