Fixed PCX loader crash

Former-commit-id: 3c0734a67d271a68f79a56e986ebd96552ae6d4b
This commit is contained in:
Lynix 2014-09-03 13:35:10 +02:00
parent 7a40f4ed00
commit ce2aa91b32
1 changed files with 2 additions and 2 deletions

View File

@ -287,7 +287,7 @@ namespace
/* for each color plane */ /* for each color plane */
for (int c = 0; c < 3; ++c) for (int c = 0; c < 3; ++c)
{ {
nzUInt8* ptr = &pixels[y * width * 4]; nzUInt8* ptr = &pixels[y * width * 3];
int bytes = header.bytesPerScanLine; int bytes = header.bytesPerScanLine;
/* decode line number y */ /* decode line number y */
@ -324,7 +324,7 @@ namespace
} }
default: default:
NazaraError("Failed to load " + NzString::Number(bitCount) + " bitcount pcx files"); NazaraError("Unsupported " + NzString::Number(bitCount) + " bitcount for pcx files");
return false; return false;
} }