2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 03:47:43 +00:00

crash fixes

This commit is contained in:
Jack Andersen
2015-09-01 11:46:40 -10:00
parent c98ebe2fbe
commit 74e0588a63
3 changed files with 5 additions and 5 deletions

View File

@@ -442,14 +442,15 @@ static void DecodeCMPR(png_structrp png, png_infop info,
png_write_info(png, info);
/* Decode 8 rows at a time */
std::unique_ptr<uint32_t[]> buf(new uint32_t[width*8]);
int bwidth = (width + 7) / 8;
int bpwidth = bwidth * 8;
std::unique_ptr<uint32_t[]> buf(new uint32_t[bpwidth*8]);
uint32_t* bTargets[4] = {
buf.get(),
buf.get() + 4,
buf.get() + 4 * width,
buf.get() + 4 * width + 4
};
int bwidth = (width + 7) / 8;
for (int y=height/8-1 ; y>=0 ; --y)
{
const DXTBlock* blks = (DXTBlock*)(texels + 32 * bwidth * y);