projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
50cf5a7
)
imc: Catch a division by zero
author
Luca Barbato
<lu_zero@gentoo.org>
Tue, 9 Jul 2013 07:18:16 +0000
(09:18 +0200)
committer
Luca Barbato
<lu_zero@gentoo.org>
Tue, 9 Jul 2013 08:49:29 +0000
(10:49 +0200)
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
libavcodec/imc.c
patch
|
blob
|
history
diff --git
a/libavcodec/imc.c
b/libavcodec/imc.c
index
2749099
..
e3f5e15
100644
(file)
--- a/
libavcodec/imc.c
+++ b/
libavcodec/imc.c
@@
-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;