Browse Source

* Check the magic bytes at the end of the buffer when cucul_load()ing it.

tags/v0.99.beta14
Sam Hocevar sam 18 years ago
parent
commit
fcfbcd4000
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      cucul/cucul.c

+ 4
- 0
cucul/cucul.c View File

@@ -96,6 +96,10 @@ cucul_t *cucul_load(void *data, unsigned int size)
if(size != 12 + width * height * 5 + 4)
return NULL;

if(buf[size - 4] != 'A' || buf[size - 3] != 'C'
|| buf[size - 2] != 'A' || buf[size - 1] != 'C')
return NULL;

qq = cucul_create(width, height);

if(!qq)


Loading…
Cancel
Save