mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2024-11-22 13:53:02 +05:30
Fixed memory allocation size for struct PldHeader
This commit is contained in:
parent
a67fa5a952
commit
7179aba632
2
main.c
2
main.c
@ -14,7 +14,7 @@ void disp_pldheader(struct PldHeader *x) {
|
||||
|
||||
bool read_pldheader(const char *buffer) {
|
||||
int32_t *n = (int32_t*)buffer;
|
||||
struct PldHeader *ph = (struct PldHeader*)malloc(1);
|
||||
struct PldHeader *ph = (struct PldHeader*)malloc(sizeof(struct PldHeader));
|
||||
unsigned int size_offsets = sizeof(uint32_t) * n[0];
|
||||
ph -> offsets = (uint32_t*)malloc(size_offsets);
|
||||
if (ph -> offsets == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user