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 #2839 for details.
  • Loading branch information
gonetz committed Jun 1, 2024
1 parent 4972e76 commit 85bdd45
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 85bdd45

Please sign in to comment.