diff options
| author | Blockguy24 <[email protected]> | 2024-01-14 21:21:29 +1100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-01-14 11:21:29 +0100 |
| commit | d2b1256e5c3567484486ad70cc2bb69495abfbf4 (patch) | |
| tree | 4a69c78116f9c1801417b6bab31cbd177f94b4c1 /src | |
| parent | 02133092f899bf17a0ad24fbde9a8775837ccac8 (diff) | |
| download | raylib-d2b1256e5c3567484486ad70cc2bb69495abfbf4.tar.gz raylib-d2b1256e5c3567484486ad70cc2bb69495abfbf4.zip | |
Fix bounds check for `ImageDrawRectangleRec` (#3732)
Diffstat (limited to 'src')
| -rw-r--r-- | src/rtextures.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rtextures.c b/src/rtextures.c index cdec7a3a..fb726137 100644 --- a/src/rtextures.c +++ b/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; |
