diff --git a/engines/sci/compress_sci.cpp b/engines/sci/compress_sci.cpp
index 3d82b7e..d21c4b4 100644
a
|
b
|
SciResourceDataType CompressSci::detectData(byte *header, bool compressMode) {
|
67 | 67 | byte buffer[20]; |
68 | 68 | uint32 dataSize; |
69 | 69 | memcpy(&buffer, header, 6); |
70 | | if ((memcmp(buffer + 1, "RIFF", 4) == 0) || (memcmp(buffer + 1, "\x8d\x0bSOL", 4) == 0)) { |
| 70 | int offset = (memcmp(buffer + 1, "RIFF", 4) == 0) * 5 + (memcmp(buffer + 1, "\x8d\x0bSOL\x00", 6) == 0) * 7; |
| 71 | if (offset) { |
71 | 72 | // Fixup for pharkas resource.sfx, several WAVE files contain a size thats not right (-1 byte) |
72 | | for (int i = 0; i < 5; i++) |
| 73 | for (int i = 0; i < offset; i++) |
73 | 74 | buffer[i] = buffer[i + 1]; |
74 | | _input.read_throwsOnError(&buffer[5], 1); |
| 75 | _input.read_throwsOnError(&buffer[offset], 1); |
75 | 76 | _inputOffset++; |
76 | 77 | warning("WAVE resource position adjusted at %lx\n", _inputOffset); |
77 | 78 | } |