mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-10 05:18:13 +00:00
Added SDL_copyp to avoid size mismatch when copying values (thanks @1bsyl!)
Closes https://github.com/libsdl-org/SDL/pull/5811
This commit is contained in:
@@ -1254,8 +1254,8 @@ GL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic
|
||||
|
||||
case SDL_RENDERCMD_SETVIEWPORT: {
|
||||
SDL_Rect *viewport = &data->drawstate.viewport;
|
||||
if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof (SDL_Rect)) != 0) {
|
||||
SDL_memcpy(viewport, &cmd->data.viewport.rect, sizeof (SDL_Rect));
|
||||
if (SDL_memcmp(viewport, &cmd->data.viewport.rect, sizeof(cmd->data.viewport.rect)) != 0) {
|
||||
SDL_copyp(viewport, &cmd->data.viewport.rect);
|
||||
data->drawstate.viewport_dirty = SDL_TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -1268,8 +1268,8 @@ GL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic
|
||||
data->drawstate.cliprect_enabled_dirty = SDL_TRUE;
|
||||
}
|
||||
|
||||
if (SDL_memcmp(&data->drawstate.cliprect, rect, sizeof (SDL_Rect)) != 0) {
|
||||
SDL_memcpy(&data->drawstate.cliprect, rect, sizeof (SDL_Rect));
|
||||
if (SDL_memcmp(&data->drawstate.cliprect, rect, sizeof(*rect)) != 0) {
|
||||
SDL_copyp(&data->drawstate.cliprect, rect);
|
||||
data->drawstate.cliprect_dirty = SDL_TRUE;
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user