Error if the coordinates given to Canvas:getPIxel are not within [0, dimensions).

This commit is contained in:
Alex Szpakowski
2014-08-10 03:09:16 -03:00
parent 27c75a1323
commit 1798115858
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -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.