Remove flexible array member

This commit is contained in:
Alexander Batalov 2022-05-21 20:05:34 +03:00
parent 98c6acbf11
commit 44ae520284
2 changed files with 4 additions and 6 deletions

View File

@ -415,7 +415,7 @@ unsigned char* artLockFrameData(int fid, int frame, int direction, CacheEntry**
frm = artGetFrame(art, frame, direction);
if (frm != NULL) {
return frm->data;
return (unsigned char*)frm + sizeof(*frm);
}
}
@ -777,7 +777,7 @@ unsigned char* artGetFrameData(Art* art, int frame, int direction)
return NULL;
}
return frm->data;
return (unsigned char*)frm + sizeof(*frm);
}
// 0x419880
@ -795,9 +795,9 @@ ArtFrame* artGetFrame(Art* art, int frame, int rotation)
return NULL;
}
ArtFrame* frm = (ArtFrame*)(art->data + art->dataOffsets[rotation]);
ArtFrame* frm = (ArtFrame*)((unsigned char*)art + sizeof(*art) + art->dataOffsets[rotation]);
for (int index = 0; index < frame; index++) {
frm = (ArtFrame*)(frm->data + frm->size);
frm = (ArtFrame*)((unsigned char*)frm + sizeof(*frm) + frm->size);
}
return frm;
}

View File

@ -77,7 +77,6 @@ typedef struct Art {
short yOffsets[6];
int dataOffsets[6];
int field_3A;
unsigned char data[];
} Art;
#pragma pack()
@ -89,7 +88,6 @@ typedef struct ArtFrame {
int size;
short x;
short y;
unsigned char data[];
} ArtFrame;
typedef struct ArtListDescription {