From 2d95612882f1b850932f409d179060823f2056c4 Mon Sep 17 00:00:00 2001 From: sonil Date: Tue, 23 Jan 2024 22:12:50 +0800 Subject: [PATCH] fix game crash in fallout 1.5 mod --- src/art.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/art.cc b/src/art.cc index 18be454..c9dcbe8 100644 --- a/src/art.cc +++ b/src/art.cc @@ -1146,7 +1146,7 @@ int artRead(const char* path, unsigned char* data) for (int index = 0; index < ROTATION_COUNT; index++) { 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; currentPadding += previousPadding; if (artReadFrameData(data + sizeof(Art) + art->dataOffsets[index] + art->padding[index], stream, art->frameCount, &previousPadding) != 0) {