浏览代码

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

tags/v0.99.beta14
Sam Hocevar sam 19 年前
父节点
当前提交
a1deddf2a6
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. +2
    -1
      cucul/canvas.c

+ 2
- 1
cucul/canvas.c 查看文件

@@ -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; endi = (x + src->width >= dst->width) ? dst->width - x : src->width;
endj = (y + src->height >= dst->height) ? dst->height - y : src->height; 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; return 0;


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


正在加载...
取消
保存