summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-10-15 11:20:53 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-10-15 11:21:50 -0300
commit345dbe26b797bb528a98ac4f4153351093d47431 (patch)
treeca867c2e75a4fa7b85dab14c5a0dc02649cd8a95 /src
parent7e7465379fbe79da573ac961a51bfcdabd970409 (diff)
lz4: fix potential div by zero
Summary: LZ4F_getBlockSize() can return 0 CID 1404010 Reviewers: lauromoura Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10392
Diffstat (limited to 'src')
-rw-r--r--src/static_libs/lz4/lz4frame.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/static_libs/lz4/lz4frame.c b/src/static_libs/lz4/lz4frame.c
index a10e4af..95da80e 100644
--- a/src/static_libs/lz4/lz4frame.c
+++ b/src/static_libs/lz4/lz4frame.c
@@ -334,7 +334,7 @@ static size_t LZ4F_compressBound_internal(size_t srcSize,
334 size_t const maxBuffered = blockSize - 1; 334 size_t const maxBuffered = blockSize - 1;
335 size_t const bufferedSize = MIN(alreadyBuffered, maxBuffered); 335 size_t const bufferedSize = MIN(alreadyBuffered, maxBuffered);
336 size_t const maxSrcSize = srcSize + bufferedSize; 336 size_t const maxSrcSize = srcSize + bufferedSize;
337 unsigned const nbFullBlocks = (unsigned)(maxSrcSize / blockSize); 337 unsigned const nbFullBlocks = blockSize ? (unsigned)(maxSrcSize / blockSize) : 0;
338 size_t const partialBlockSize = maxSrcSize & (blockSize-1); 338 size_t const partialBlockSize = maxSrcSize & (blockSize-1);
339 size_t const lastBlockSize = flush ? partialBlockSize : 0; 339 size_t const lastBlockSize = flush ? partialBlockSize : 0;
340 unsigned const nbBlocks = nbFullBlocks + (lastBlockSize>0); 340 unsigned const nbBlocks = nbFullBlocks + (lastBlockSize>0);