mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Error if the coordinates given to Canvas:getPIxel are not within [0, dimensions).
This commit is contained in:
@@ -891,6 +891,9 @@ love::image::ImageData *Canvas::getImageData(love::image::Image *image)
|
||||
|
||||
void Canvas::getPixel(unsigned char* pixel_rgba, int x, int y)
|
||||
{
|
||||
if (x < 0 || x >= width || y < 0 || y >= width)
|
||||
throw love::Exception("Attempt to get out-of-range pixel (%d,%d)!", x, y);
|
||||
|
||||
resolveMSAA();
|
||||
|
||||
// Our texture is attached to 'resolve_fbo' when we use MSAA.
|
||||
|
||||
Reference in New Issue
Block a user