From 217bc17a21a91737365475b5b44637eba82158f4 Mon Sep 17 00:00:00 2001 From: Ivan Epifanov Date: Thu, 17 Oct 2024 17:41:35 +0300 Subject: [PATCH] VITA: fix yuv texture update (cherry picked from commit 86fd4ed83cdcf71fef6a57766b126e88f923acd3) --- src/render/vitagxm/SDL_render_vita_gxm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/render/vitagxm/SDL_render_vita_gxm.c b/src/render/vitagxm/SDL_render_vita_gxm.c index 7d8085902d4c9..c8cbcb5d85a6f 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm.c +++ b/src/render/vitagxm/SDL_render_vita_gxm.c @@ -366,6 +366,7 @@ static int VITA_GXM_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, length = rect->w * SDL_BYTESPERPIXEL(texture->format); if (length == pitch && length == dpitch) { SDL_memcpy(dst, pixels, length * rect->h); + pixels += pitch * rect->h; } else { for (row = 0; row < rect->h; ++row) { SDL_memcpy(dst, pixels, length); @@ -393,6 +394,7 @@ static int VITA_GXM_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, // U plane if (length == uv_src_pitch && length == uv_pitch) { SDL_memcpy(Udst, pixels, length * UVrect.h); + pixels += uv_src_pitch * UVrect.h; } else { for (row = 0; row < UVrect.h; ++row) { SDL_memcpy(Udst, pixels, length);