Browse Source

* Fix a segfault in rotate_180 on 0 sized canvas

tags/v0.99.beta17
Pascal Terjan pterjan 15 years ago
parent
commit
52a0decd07
2 changed files with 5 additions and 0 deletions
  1. +3
    -0
      caca/transform.c
  2. +2
    -0
      tests/simple.c

+ 3
- 0
caca/transform.c View File

@@ -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 View File

@@ -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…
Cancel
Save