Do not read past the end of the buffer

This commit is contained in:
Bertold Van den Bergh 2019-08-14 10:51:46 +02:00
parent 541d59b445
commit a1460b4578

View file

@ -141,6 +141,10 @@ static unsigned int ZDDecodeVariableLengthUnsigned(const ZoneDetect *library, ui
static unsigned int ZDDecodeVariableLengthUnsignedReverse(const ZoneDetect *library, uint32_t *index, uint64_t *result){
uint32_t i = *index;
if(*index >= (uint32_t)library->length) {
return 0;
}
#if defined(_MSC_VER)
__try {
#endif