Sfoglia il codice sorgente

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

tags/v0.99.beta14
Sam Hocevar sam 19 anni fa
parent
commit
a1deddf2a6
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. +2
    -1
      cucul/canvas.c

+ 2
- 1
cucul/canvas.c Vedi 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++)


Caricamento…
Annulla
Salva