aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-28 01:23:40 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-01 13:28:14 +0100
commit8cba067fe52a717bdd2d3ed16c5c06bce54fa7a0 (patch)
tree3f6d39e7d94c84d6e147e7c8f5e1263476c18d06 /libavcodec
parent73c6520c096b017e0a464718fee683abae4c5d2c (diff)
downloadffmpeg-8cba067fe52a717bdd2d3ed16c5c06bce54fa7a0.tar.gz
avcodec/diracdec: Use 64bit in calculation of codeblock coordinates
Fixes integer overflow Fixes out of array read Fixes: asan_heap-oob_107866c_42_041.drc Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 526886e6069636a918c8c04db17e864e3d8151c1) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/diracdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index c03f45c928..0511f1c391 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -612,10 +612,10 @@ static av_always_inline void decode_subband_internal(DiracContext *s, SubBand *b
top = 0;
for (cb_y = 0; cb_y < cb_height; cb_y++) {
- bottom = (b->height * (cb_y+1)) / cb_height;
+ bottom = (b->height * (cb_y+1LL)) / cb_height;
left = 0;
for (cb_x = 0; cb_x < cb_width; cb_x++) {
- right = (b->width * (cb_x+1)) / cb_width;
+ right = (b->width * (cb_x+1LL)) / cb_width;
codeblock(s, b, &gb, &c, left, right, top, bottom, blockcnt_one, is_arith);
left = right;
}