diff --git a/src/render/psp/SDL_render_psp.c b/src/render/psp/SDL_render_psp.c index 7246bfffcc6e6..43fd377a10604 100644 --- a/src/render/psp/SDL_render_psp.c +++ b/src/render/psp/SDL_render_psp.c @@ -439,9 +439,9 @@ static int PSP_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, prepareTextureForDownload(texture); *pixels = - (void *)((Uint8 *)psp_tex->data + rect->y * psp_tex->width * SDL_BYTESPERPIXEL(texture->format) + + (void *)((Uint8 *)psp_tex->data + rect->y * psp_tex->pitch + rect->x * SDL_BYTESPERPIXEL(texture->format)); - *pitch = psp_tex->width * SDL_BYTESPERPIXEL(texture->format); + *pitch = psp_tex->pitch; return 0; }