forked from tTh/FloatImg
clean memory before use
This commit is contained in:
parent
b23ebec4a5
commit
d571d05431
|
@ -74,6 +74,7 @@ if (NULL==fp) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(&filehead, 0, sizeof(filehead));
|
||||||
strcpy(filehead.magic, "FIMG");
|
strcpy(filehead.magic, "FIMG");
|
||||||
filehead.w = fimg->width; filehead.h = fimg->height;
|
filehead.w = fimg->width; filehead.h = fimg->height;
|
||||||
filehead.t = fimg->type;
|
filehead.t = fimg->type;
|
||||||
|
@ -138,6 +139,6 @@ if (foo) {
|
||||||
foo = fread(head->R, sizeof(float), filehead.w*filehead.h*3, fp);
|
foo = fread(head->R, sizeof(float), filehead.w*filehead.h*3, fp);
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue