MDL: Fix overflow check (#6047)

This commit is contained in:
Kim Kulling
2025-03-13 00:07:41 +01:00
committed by GitHub
parent 7f2c9d7b88
commit bcf11c252a

View File

@@ -420,7 +420,7 @@ void MDLImporter::InternReadFile_Quake1() {
}
// go to the end of the skin section / the beginning of the next skin
bool overflow = false;
if (pcHeader->skinwidth != 0 || pcHeader->skinheight != 0) {
if (pcHeader->skinwidth != 0 && pcHeader->skinheight != 0) {
if ((pcHeader->skinheight > INT_MAX / pcHeader->skinwidth) || (pcHeader->skinwidth > INT_MAX / pcHeader->skinheight)){
overflow = true;
}