浏览代码

Fix bounds check for `ImageDrawRectangleRec` (#3732)

pull/3737/head
Blockguy24 1年前
committed by GitHub
父节点
当前提交
d2b1256e5c
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      src/rtextures.c

+ 2
- 2
src/rtextures.c 查看文件

@ -3586,8 +3586,8 @@ void ImageDrawRectangleRec(Image *dst, Rectangle rec, Color color)
if ((rec.y + rec.height) >= dst->height) rec.height = dst->height - rec.y;
// Check if the rect is even inside the image
if ((rec.x > dst->width) || (rec.y > dst->height)) return;
if (((rec.x + rec.width) < 0) || (rec.y + rec.height < 0)) return;
if ((rec.x >= dst->width) || (rec.y >= dst->height)) return;
if (((rec.x + rec.width) <= 0) || (rec.y + rec.height <= 0)) return;
int sy = (int)rec.y;
int sx = (int)rec.x;

||||||
x
 
000:0
正在加载...
取消
保存