Some memory leaks and out of bounds array access fixed (#4498)

This commit is contained in:
Damjan Adamic
2017-02-26 12:39:26 +01:00
committed by Bertrand Songis
parent 1910af51b6
commit 7081f924de
7 changed files with 35 additions and 31 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ unsigned int compress(uint8_t * dst, unsigned int dstsize, const uint8_t * src,
uint8_t cnt0 = 0;
for (unsigned int i=1; 1; i++) {
bool cur0 = (src[i] == 0);
bool cur0 = (i < srcsize) ? (src[i] == 0) : false;
if (i==srcsize || cur0!=run0 || cnt==0x3f || (cnt0 && cnt==0xf)) {
if (run0) {
assert(cnt0==0);