mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 08:22:32 +00:00
fix stride calculation
This commit is contained in:
parent
7e663fe4f5
commit
4e5d39bf23
@ -171,8 +171,9 @@ s32 PS4_SYSV_ABI scePngDecDecode(OrbisPngDecHandle handle, const OrbisPngDecDeco
|
||||
auto ptr = (png_bytep)param->imageMemAddr;
|
||||
|
||||
auto const numChannels = png_get_channels(pngh->png_ptr, pngh->info_ptr);
|
||||
auto horizontal_bytes = numChannels * width;
|
||||
|
||||
int stride = param->imagePitch > 0 ? (param->imagePitch - width) : 0;
|
||||
int stride = param->imagePitch > 0 ? (param->imagePitch - horizontal_bytes) : 0;
|
||||
for (int y = 0; y < height; y++) {
|
||||
for (int x = 0; x < numChannels * width; x++) {
|
||||
*ptr++ = row_pointers[y][x];
|
||||
|
Loading…
Reference in New Issue
Block a user