mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-23 05:25:56 +00:00
Keep a texture's pool flags instead of reading its pool object later
tex_mirrored (vk_texture.c) read t->pool->flags whenever the back end created the host entry of a texture, which can happen long after nvnTextureInitialize. A game may finalize a memory pool and free the memory the NVNmemoryPool object lived in while textures from it are still looked up (on a level change, for instance); reading the freed object then faults. The NVN driver keeps no pointer to the pool either. tex_t now records the pool's flags at Initialize, in the padding after layout[8], so NVNtexture's size is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ab1dee5bdb
commit
3675286747
4 files changed
+6
-3
No files matched your search
@@ -197,6 +197,7 @@ NVN_API(nvnTextureInitialize) {
|
||||
o->magic = NVN_TEX_MAGIC;
|
||||
o->d = s->d;
|
||||
o->pool = s->pool;
|
||||
o->pool_flags = s->pool ? (uint16_t)s->pool->flags : 0;
|
||||
o->off = s->off;
|
||||
o->has_layout = s->has_layout;
|
||||
memcpy(o->layout, s->layout, 8);
|
||||
|
||||
Reference in new issue
Block a user