fix game crash in fallout 1.5 mod

This commit is contained in:
sonil 2024-01-23 22:12:50 +08:00
parent 8325823493
commit 2d95612882
1 changed files with 1 additions and 1 deletions

View File

@ -1146,7 +1146,7 @@ int artRead(const char* path, unsigned char* data)
for (int index = 0; index < ROTATION_COUNT; index++) { for (int index = 0; index < ROTATION_COUNT; index++) {
art->padding[index] = currentPadding; art->padding[index] = currentPadding;
if (index == 0 || art->dataOffsets[index - 1] != art->dataOffsets[index]) { if (index == 0 || (art->dataOffsets[index - 1] != art->dataOffsets[index] && art->dataOffsets[index] < art->dataSize)) {
art->padding[index] += previousPadding; art->padding[index] += previousPadding;
currentPadding += previousPadding; currentPadding += previousPadding;
if (artReadFrameData(data + sizeof(Art) + art->dataOffsets[index] + art->padding[index], stream, art->frameCount, &previousPadding) != 0) { if (artReadFrameData(data + sizeof(Art) + art->dataOffsets[index] + art->padding[index], stream, art->frameCount, &previousPadding) != 0) {