FIX: Fix possible division by zero
- closes https://github.com/assimp/assimp/issues/4819pull/4820/head
parent
b0987f4513
commit
62486c6e7c
|
@ -405,6 +405,7 @@ void MDLImporter::InternReadFile_Quake1() {
|
||||||
}
|
}
|
||||||
// go to the end of the skin section / the beginning of the next skin
|
// go to the end of the skin section / the beginning of the next skin
|
||||||
bool overflow = false;
|
bool overflow = false;
|
||||||
|
if (pcHeader->skinwidth != 0 || pcHeader->skinheight != 0) {
|
||||||
if ((pcHeader->skinheight > INT_MAX / pcHeader->skinwidth) || (pcHeader->skinwidth > INT_MAX / pcHeader->skinheight)){
|
if ((pcHeader->skinheight > INT_MAX / pcHeader->skinwidth) || (pcHeader->skinwidth > INT_MAX / pcHeader->skinheight)){
|
||||||
overflow = true;
|
overflow = true;
|
||||||
}
|
}
|
||||||
|
@ -412,6 +413,7 @@ void MDLImporter::InternReadFile_Quake1() {
|
||||||
szCurrent += pcHeader->skinheight * pcHeader->skinwidth +sizeof(float) * iNumImages;
|
szCurrent += pcHeader->skinheight * pcHeader->skinwidth +sizeof(float) * iNumImages;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
szCurrent += sizeof(uint32_t);
|
szCurrent += sizeof(uint32_t);
|
||||||
unsigned int iSkip = i ? UINT_MAX : 0;
|
unsigned int iSkip = i ? UINT_MAX : 0;
|
||||||
|
|
Loading…
Reference in New Issue