mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 09:35:23 -04:00
NDS: Fix crashing when downloading resources fails
This commit is contained in:
parent
d98304c617
commit
0a95076da4
@ -922,6 +922,8 @@ static void PatchTerrainTile(struct Bitmap* src, int srcX, int srcY, int tileX,
|
|||||||
static const cc_string terrainPng = String_FromConst("terrain.png");
|
static const cc_string terrainPng = String_FromConst("terrain.png");
|
||||||
struct ResourceZipEntry* entry = ZipEntries_Find(&terrainPng);
|
struct ResourceZipEntry* entry = ZipEntries_Find(&terrainPng);
|
||||||
struct Bitmap* dst = &entry->value.bmp;
|
struct Bitmap* dst = &entry->value.bmp;
|
||||||
|
/* Can happen sometimes happen when allocating memory for terrain.png fails */
|
||||||
|
if (!dst->scan0) return;
|
||||||
|
|
||||||
Bitmap_UNSAFE_CopyBlock(srcX, srcY, tileX * 16, tileY * 16, src, dst, 16);
|
Bitmap_UNSAFE_CopyBlock(srcX, srcY, tileX * 16, tileY * 16, src, dst, 16);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user