Skip to content

Commit

Permalink
Do not load texture if tile width or height is negative.
Browse files Browse the repository at this point in the history
See gonetz#2839 for details.
  • Loading branch information
gonetz authored and cheinr committed Sep 8, 2024
1 parent 181a790 commit 9cbc7c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Textures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2091,6 +2091,12 @@ void TextureCache::update(u32 _t)
pTile = gSP.textureTile[_t];
}

// Sanity check
if ((int)pTile->lrs - (int)pTile->uls < 0 || (int)pTile->lrt - (int)pTile->ult < 0) {
activateDummy(_t);
return;
}

TileSizes sizes;
_calcTileSizes(_t, sizes, gDP.loadTile);
TextureParams params;
Expand Down

0 comments on commit 9cbc7c7

Please sign in to comment.