Possible fix for crash in gfx_texture_cache_lookup()

This commit is contained in:
MysterD 2022-05-03 22:11:44 -07:00
parent 7868a61d6a
commit 7576dfbc7c

View file

@ -308,7 +308,7 @@ static bool gfx_texture_cache_lookup(int tile, struct TextureHashmapNode **n, co
}
node = &(*node)->next;
}
if (gfx_texture_cache.pool_pos == sizeof(gfx_texture_cache.pool) / sizeof(struct TextureHashmapNode)) {
if (gfx_texture_cache.pool_pos >= sizeof(gfx_texture_cache.pool) / sizeof(struct TextureHashmapNode)) {
// Pool is full. We just invalidate everything and start over.
gfx_texture_cache.pool_pos = 0;
node = &gfx_texture_cache.hashmap[hash];