瀏覽代碼

* Fix a segfault in rotate_180 on 0 sized canvas

tags/v0.99.beta17
Pascal Terjan pterjan 15 年之前
父節點
當前提交
52a0decd07
共有 2 個檔案被更改,包括 5 行新增0 行删除
  1. +3
    -0
      caca/transform.c
  2. +2
    -0
      tests/simple.c

+ 3
- 0
caca/transform.c 查看文件

@@ -191,6 +191,9 @@ int caca_rotate_180(caca_canvas_t *cv)
uint32_t *aend = abegin + cv->width * cv->height - 1;
int y;

if(!cbegin)
return 0;

while(cbegin < cend)
{
uint32_t ch;


+ 2
- 0
tests/simple.c 查看文件

@@ -41,6 +41,8 @@ int main(int argc, char *argv[])
caca_put_char(cv, 0, 0, 'x');
TEST(caca_get_char(cv, 0, 0) != 'x');

caca_rotate_180(cv);

caca_set_canvas_size(cv, 1, 1);
TEST(caca_get_char(cv, 0, 0) != 'x');
TEST(caca_get_char(cv, 0, 0) == ' ');


Loading…
取消
儲存