From 37982c0fb399802fb5a46d86fd0df69ae64650cb Mon Sep 17 00:00:00 2001 From: enselic Date: Sun, 11 Jan 2009 11:08:25 +0000 Subject: src/rmd_get_frame.c: Work around issue with underflow in rmdBlocksFromList(). I call this a "workaround" because the whole code base needs to stop using unsigned so much IMO. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@592 f606c939-3180-4ac9-a4b8-4b8779d57d0a --- recordmydesktop/src/rmd_get_frame.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'recordmydesktop') diff --git a/recordmydesktop/src/rmd_get_frame.c b/recordmydesktop/src/rmd_get_frame.c index cb00edb..dd2a818 100644 --- a/recordmydesktop/src/rmd_get_frame.c +++ b/recordmydesktop/src/rmd_get_frame.c @@ -319,13 +319,13 @@ static void rmdBlocksFromList (RectArea **root, unsigned int blocknum_y) { RectArea *temp; - unsigned int i, - j, - blockno, - row_start, - row_end, - column_start, - column_end; + int i, + j, + blockno, + row_start, + row_end, + column_start, + column_end; temp = *root; @@ -335,10 +335,10 @@ static void rmdBlocksFromList (RectArea **root, while (temp != NULL) { - column_start = (temp->rect.x - x_offset) / Y_UNIT_WIDTH; - column_end = (temp->rect.x + (temp->rect.width - 1) - x_offset) / Y_UNIT_WIDTH; - row_start = (temp->rect.y - y_offset) / Y_UNIT_WIDTH; - row_end = (temp->rect.y + (temp->rect.height - 1) - y_offset) / Y_UNIT_WIDTH; + column_start = ((int)(temp->rect.x - x_offset)) / Y_UNIT_WIDTH; + column_end = ((int)(temp->rect.x + (temp->rect.width - 1) - x_offset)) / Y_UNIT_WIDTH; + row_start = ((int)(temp->rect.y - y_offset)) / Y_UNIT_WIDTH; + row_end = ((int)(temp->rect.y + (temp->rect.height - 1) - y_offset)) / Y_UNIT_WIDTH; for (i = row_start; i < row_end + 1; i++) { for (j = column_start; j < column_end + 1; j++) { -- cgit v1.2.3