Core: Return null for out of bounds cached tile VRAM querying
Vicki Pfau vi@endrift.com
Wed, 18 Dec 2019 18:21:01 -0800
3 files changed,
8 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -95,6 +95,7 @@ - GBA Memory: Fix open bus from IWRAM (fixes mgba.io/i/1575)
Other fixes: - 3DS: Fix screen darkening (fixes mgba.io/i/1562) - Core: Fix uninitialized memory issues with graphics caches + - Core: Return null for out of bounds cached tile VRAM querying - Vita: Fix analog controls (fixes mgba.io/i/1554) - Qt: Fix fast forward mute being reset (fixes mgba.io/i/1574) - Qt: Fix scrollbar arrows in memory view (fixes mgba.io/i/1558)
M
src/core/tile-cache.c
→
src/core/tile-cache.c
@@ -281,5 +281,9 @@ return &cache->palette[paletteId << (1 << cache->bpp)];
} const uint16_t* mTileCacheGetVRAM(struct mTileCache* cache, unsigned tileId) { + unsigned tiles = mTileCacheSystemInfoGetMaxTiles(cache->sysConfig); + if (tileId >= tiles) { + return NULL; + } return &cache->vram[tileId << (cache->bpp + 2)]; }
M
src/platform/qt/AssetView.cpp
→
src/platform/qt/AssetView.cpp
@@ -66,6 +66,9 @@ updateTiles(true);
} void AssetView::compositeTile(const void* tBuffer, void* buffer, size_t stride, size_t x, size_t y, int depth) { + if (!tBuffer) { + return; + } const uint8_t* tile = static_cast<const uint8_t*>(tBuffer); uint8_t* pixels = static_cast<uint8_t*>(buffer); size_t base = stride * y + x;