mirror of
https://github.com/Takiiiiiiii/strato.git
synced 2025-07-17 08:46:39 +00:00
Avoid OOB memory acceses when trying to read OOB TICs
Some games pass in invalid texture handles (0xffff) when they don't need the texture so return the null texture in this case.
This commit is contained in:
@ -225,7 +225,8 @@ namespace skyline::gpu::interconnect {
|
||||
if (textureHeaderCache.size() != textureHeaders.size()) {
|
||||
textureHeaderCache.resize(textureHeaders.size());
|
||||
std::fill(textureHeaderCache.begin(), textureHeaderCache.end(), CacheEntry{});
|
||||
} else if (auto &cached{textureHeaderCache[index]}; cached.view) {
|
||||
} else if (textureHeaders.size() > index && textureHeaderCache[index].view) {
|
||||
auto &cached{textureHeaderCache[index]};
|
||||
if (cached.executionTag == ctx.executor.executionTag)
|
||||
return cached.view;
|
||||
|
||||
@ -235,6 +236,13 @@ namespace skyline::gpu::interconnect {
|
||||
}
|
||||
}
|
||||
|
||||
if (index >= textureHeaders.size()) {
|
||||
if (!nullTextureView)
|
||||
nullTextureView = CreateNullTexture(ctx);
|
||||
|
||||
return nullTextureView.get();
|
||||
}
|
||||
|
||||
TextureImageControl &textureHeader{textureHeaders[index]};
|
||||
auto &texture{textureHeaderStore[textureHeader]};
|
||||
|
||||
|
Reference in New Issue
Block a user