mirror of https://github.com/encounter/SDL.git
More "Integer overflow generates Illegal instruction under sanitizers" (see bug #4995)
This commit is contained in:
parent
e5467af7c8
commit
2a24418bd3
|
@ -1084,7 +1084,7 @@ METAL_QueueSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
|
||||||
static int
|
static int
|
||||||
METAL_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count)
|
METAL_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count)
|
||||||
{
|
{
|
||||||
const int color = (cmd->data.draw.r << 0) | (cmd->data.draw.g << 8) | (cmd->data.draw.b << 16) | (cmd->data.draw.a << 24);
|
const int color = (cmd->data.draw.r << 0) | (cmd->data.draw.g << 8) | (cmd->data.draw.b << 16) | ((Uint32)cmd->data.draw.a << 24);
|
||||||
const size_t vertlen = (2 * sizeof (float) + sizeof (int)) * count;
|
const size_t vertlen = (2 * sizeof (float) + sizeof (int)) * count;
|
||||||
float *verts = (float *) SDL_AllocateRenderVertices(renderer, vertlen, DEVICE_ALIGN(8), &cmd->data.draw.first);
|
float *verts = (float *) SDL_AllocateRenderVertices(renderer, vertlen, DEVICE_ALIGN(8), &cmd->data.draw.first);
|
||||||
if (!verts) {
|
if (!verts) {
|
||||||
|
@ -1104,7 +1104,7 @@ static int
|
||||||
METAL_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count)
|
METAL_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count)
|
||||||
{
|
{
|
||||||
|
|
||||||
const int color = (cmd->data.draw.r << 0) | (cmd->data.draw.g << 8) | (cmd->data.draw.b << 16) | (cmd->data.draw.a << 24);
|
const int color = (cmd->data.draw.r << 0) | (cmd->data.draw.g << 8) | (cmd->data.draw.b << 16) | ((Uint32)cmd->data.draw.a << 24);
|
||||||
|
|
||||||
SDL_assert(count >= 2); /* should have been checked at the higher level. */
|
SDL_assert(count >= 2); /* should have been checked at the higher level. */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue