diff options
author | Benjamin Otte <otte@redhat.com> | 2011-10-15 00:05:28 -0700 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-10-15 00:06:22 -0700 |
commit | d7a24ac78647089d74368b5fe9ede214f32cf8d3 (patch) | |
tree | 4dc969e20c547521e2d431656e94e4fca0f105c4 | |
parent | 4d09946f842a3116202ded3dab1a7f5a563e990e (diff) |
sheep: Ensure the board size doesn't cause overflow in cairo
-rw-r--r-- | games/sheep/sheep-board.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/games/sheep/sheep-board.c b/games/sheep/sheep-board.c index 1cce0c9..8e7f1db 100644 --- a/games/sheep/sheep-board.c +++ b/games/sheep/sheep-board.c @@ -77,6 +77,9 @@ sheep_board_get_type () return grid_board_type; } +/* anything larger blows up cairo and this is large enough. */ +#define VERYLARGE (2 << 12) + GameBoard * sheep_board_new (GameGame *game, SheepStuff *stuff) { @@ -86,7 +89,7 @@ sheep_board_new (GameGame *game, SheepStuff *stuff) g_return_val_if_fail (stuff != NULL, NULL); board = SHEEP_BOARD (game_game_add_object (game, SHEEP_TYPE_BOARD, - "x", -1.0, "y", (double) - G_MAXDOUBLE, "width", 7.0, "height", G_MAXDOUBLE, + "x", -1.0, "y", (double) - VERYLARGE, "width", 7.0, "height", 2.0 * VERYLARGE, NULL)); board->stuff = stuff; return GAME_BOARD (board); |