render: Corrected wrong SDL_memcpy() sizes for viewport, cliprect. Fixes #5786.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index 771c36c..7d9d97e 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -353,7 +353,7 @@ static int
QueueCmdSetViewport(SDL_Renderer *renderer)
{
int retval = 0;
- if (!renderer->viewport_queued || (SDL_memcmp(&renderer->viewport, &renderer->last_queued_viewport, sizeof (SDL_Rect)) != 0)) {
+ if (!renderer->viewport_queued || (SDL_memcmp(&renderer->viewport, &renderer->last_queued_viewport, sizeof (SDL_DRect)) != 0)) {
SDL_RenderCommand *cmd = AllocateRenderCommand(renderer);
retval = -1;
if (cmd != NULL) {
@@ -368,7 +368,7 @@ QueueCmdSetViewport(SDL_Renderer *renderer)
if (retval < 0) {
cmd->command = SDL_RENDERCMD_NO_OP;
} else {
- SDL_memcpy(&renderer->last_queued_viewport, &renderer->viewport, sizeof (SDL_Rect));
+ SDL_memcpy(&renderer->last_queued_viewport, &renderer->viewport, sizeof (SDL_DRect));
renderer->viewport_queued = SDL_TRUE;
}
}
@@ -382,7 +382,7 @@ QueueCmdSetClipRect(SDL_Renderer *renderer)
int retval = 0;
if ((!renderer->cliprect_queued) ||
(renderer->clipping_enabled != renderer->last_queued_cliprect_enabled) ||
- (SDL_memcmp(&renderer->clip_rect, &renderer->last_queued_cliprect, sizeof (SDL_Rect)) != 0)) {
+ (SDL_memcmp(&renderer->clip_rect, &renderer->last_queued_cliprect, sizeof (SDL_DRect)) != 0)) {
SDL_RenderCommand *cmd = AllocateRenderCommand(renderer);
if (cmd == NULL) {
retval = -1;
@@ -394,7 +394,7 @@ QueueCmdSetClipRect(SDL_Renderer *renderer)
cmd->data.cliprect.rect.y = (int)SDL_floor(renderer->clip_rect.y);
cmd->data.cliprect.rect.w = (int)SDL_floor(renderer->clip_rect.w);
cmd->data.cliprect.rect.h = (int)SDL_floor(renderer->clip_rect.h);
- SDL_memcpy(&renderer->last_queued_cliprect, &renderer->clip_rect, sizeof (SDL_Rect));
+ SDL_memcpy(&renderer->last_queued_cliprect, &renderer->clip_rect, sizeof (SDL_DRect));
renderer->last_queued_cliprect_enabled = renderer->clipping_enabled;
renderer->cliprect_queued = SDL_TRUE;
}