summaryrefslogtreecommitdiff
path: root/recordmydesktop/src
diff options
context:
space:
mode:
authorenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2009-01-11 11:08:25 +0000
committerenselic <enselic@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2009-01-11 11:08:25 +0000
commit37982c0fb399802fb5a46d86fd0df69ae64650cb (patch)
tree3d0dfbc16b65677c84e28a72f56e062e2e4b20a3 /recordmydesktop/src
parentd940b58648e8235ef8e9d6d29c593eaa85fac27d (diff)
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
Diffstat (limited to 'recordmydesktop/src')
-rw-r--r--recordmydesktop/src/rmd_get_frame.c22
1 files changed, 11 insertions, 11 deletions
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++) {
© All Rights Reserved