Signed-off-by: Balazs Toldi <balazs@toldi.eu>
This commit is contained in:
parent
6336b69e8e
commit
5dfbd15c33
3 changed files with 11 additions and 3 deletions
12
caff.c
12
caff.c
|
@ -61,8 +61,16 @@ CAFF *caff_parse_file(const char *filename)
|
||||||
{
|
{
|
||||||
uint8_t id;
|
uint8_t id;
|
||||||
uint64_t length;
|
uint64_t length;
|
||||||
fread(&id, sizeof(uint8_t), 1, file);
|
if(fread(&id, sizeof(uint8_t), 1, file) != 1 ||
|
||||||
fread(&length, sizeof(uint64_t), 1, file);
|
fread(&length, sizeof(uint64_t), 1, file) != 1){
|
||||||
|
printf("Failed to read block id/length!\n");
|
||||||
|
fclose(file);
|
||||||
|
if(anim_count == 0){
|
||||||
|
free(caff);
|
||||||
|
caff = NULL;
|
||||||
|
}
|
||||||
|
return caff;
|
||||||
|
}
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
|
|
2
test.c
2
test.c
|
@ -1,7 +1,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define TEST_COUNT 8
|
#define TEST_COUNT 9
|
||||||
#define COMMAND_SIZE 128
|
#define COMMAND_SIZE 128
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
|
|
0
test_cases/9.caff
Normal file
0
test_cases/9.caff
Normal file
Loading…
Reference in a new issue