Browse Source

* Fixed an out of bounds bug in cucul_blit().

tags/v0.99.beta14
Sam Hocevar sam 19 years ago
parent
commit
a1deddf2a6
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      cucul/canvas.c

+ 2
- 1
cucul/canvas.c View File

@@ -230,7 +230,8 @@ int cucul_blit(cucul_canvas_t *dst, int x, int y,
endi = (x + src->width >= dst->width) ? dst->width - x : src->width;
endj = (y + src->height >= dst->height) ? dst->height - y : src->height;

if(starti >= endi || startj >= endj)
if((unsigned int)starti > src->width || (unsigned int)startj > src->height
|| starti >= endi || startj >= endj)
return 0;

for(j = startj; j < endj; j++)


Loading…
Cancel
Save