Added line to prevent zero division.
This commit is contained in:
parent
67e216d4ee
commit
4307992cbc
1
grid.c
1
grid.c
@ -51,6 +51,7 @@ bool getPixel(Grid* grid, int x, int y)
|
|||||||
|
|
||||||
void getDimensions(Grid* grid, unsigned int* width, unsigned int* height)
|
void getDimensions(Grid* grid, unsigned int* width, unsigned int* height)
|
||||||
{
|
{
|
||||||
|
if (grid->size == 0) return;
|
||||||
*width = grid->width;
|
*width = grid->width;
|
||||||
*height = grid->size/grid->width;
|
*height = grid->size/grid->width;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user