diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/scicore/decompressor.cpp | 18 | ||||
-rw-r--r-- | engines/sci/scicore/resource.h | 19 |
2 files changed, 15 insertions, 22 deletions
diff --git a/engines/sci/scicore/decompressor.cpp b/engines/sci/scicore/decompressor.cpp index 7245d8a622..91738aa1d8 100644 --- a/engines/sci/scicore/decompressor.cpp +++ b/engines/sci/scicore/decompressor.cpp @@ -199,7 +199,7 @@ int DecompressorLZW::unpackLZW(Common::ReadStream *src, byte *dest, uint32 nPack if (token > 0xff) { if (token >= _curtoken) { warning("unpackLZW: Bad token %x", token); - return SCI_ERROR_DECOMPRESSION_INSANE; + return SCI_ERROR_DECOMPRESSION_ERROR; } tokenlastlength = tokenlengthlist[token] + 1; if (_dwWrote + tokenlastlength > _szUnpacked) { @@ -231,7 +231,7 @@ int DecompressorLZW::unpackLZW(Common::ReadStream *src, byte *dest, uint32 nPack } } - return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_INSANE; + return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR; } int DecompressorLZW::unpackLZW1(Common::ReadStream *src, byte *dest, uint32 nPacked, @@ -310,7 +310,7 @@ int DecompressorLZW::unpackLZW1(Common::ReadStream *src, byte *dest, uint32 nPac break; } } - return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_INSANE; + return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR; } #define PAL_SIZE 1284 @@ -853,12 +853,12 @@ int DecompressorDCL::unpackDCL(byte* dest) { if (val_length + _dwWrote > _szUnpacked) { warning("DCL-INFLATE Error: Write out of bounds while copying %d bytes", val_length); - return SCI_ERROR_DECOMPRESSION_OVERFLOW; + return SCI_ERROR_DECOMPRESSION_ERROR; } if (_dwWrote < val_distance) { warning("DCL-INFLATE Error: Attempt to copy from before beginning of input stream"); - return SCI_ERROR_DECOMPRESSION_INSANE; + return SCI_ERROR_DECOMPRESSION_ERROR; } while (val_length) { @@ -885,7 +885,7 @@ int DecompressorDCL::unpackDCL(byte* dest) { } } - return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_INSANE; + return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR; } #ifdef ENABLE_SCI32 @@ -910,21 +910,21 @@ int DecompressorLZS::unpackLZS() { break; if (!(clen = getCompLen())) { warning("lzsDecomp: length mismatch"); - return SCI_ERROR_DECOMPRESSION_INSANE; + return SCI_ERROR_DECOMPRESSION_ERROR; } copyComp(offs, clen); } else { // Eleven bit offset follows offs = getBitsMSB(11); if (!(clen = getCompLen())) { warning("lzsDecomp: length mismatch"); - return SCI_ERROR_DECOMPRESSION_INSANE; + return SCI_ERROR_DECOMPRESSION_ERROR; } copyComp(offs, clen); } } else // Literal byte follows putByte(getByteMSB()); } // end of while () - return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_INSANE; + return _dwWrote == _szUnpacked ? 0 : SCI_ERROR_DECOMPRESSION_ERROR; } uint16 DecompressorLZS::getCompLen() { diff --git a/engines/sci/scicore/resource.h b/engines/sci/scicore/resource.h index 3bf5c97d05..e827152c57 100644 --- a/engines/sci/scicore/resource.h +++ b/engines/sci/scicore/resource.h @@ -52,26 +52,19 @@ enum ResourceStatus { /*** INITIALIZATION RESULT TYPES ***/ #define SCI_ERROR_IO_ERROR 1 -#define SCI_ERROR_EMPTY_OBJECT 2 -#define SCI_ERROR_INVALID_RESMAP_ENTRY 3 +#define SCI_ERROR_INVALID_RESMAP_ENTRY 2 /* Invalid resource.map entry */ -#define SCI_ERROR_RESMAP_NOT_FOUND 4 -#define SCI_ERROR_NO_RESOURCE_FILES_FOUND 5 +#define SCI_ERROR_RESMAP_NOT_FOUND 3 +#define SCI_ERROR_NO_RESOURCE_FILES_FOUND 4 /* No resource at all was found */ -#define SCI_ERROR_UNKNOWN_COMPRESSION 6 -#define SCI_ERROR_DECOMPRESSION_OVERFLOW 7 -/* decompression failed: Buffer overflow (wrong SCI version?) */ -#define SCI_ERROR_DECOMPRESSION_INSANE 8 +#define SCI_ERROR_UNKNOWN_COMPRESSION 5 +#define SCI_ERROR_DECOMPRESSION_ERROR 6 /* sanity checks failed during decompression */ -#define SCI_ERROR_RESOURCE_TOO_BIG 9 +#define SCI_ERROR_RESOURCE_TOO_BIG 8 /* Resource size exceeds SCI_MAX_RESOURCE_SIZE */ -#define SCI_ERROR_UNSUPPORTED_VERSION 10 -#define SCI_ERROR_CRITICAL SCI_ERROR_NO_RESOURCE_FILES_FOUND /* the first critical error number */ -#define SCI_VERSION_LAST SCI_VERSION_1_LATE /* The last supported SCI version */ - #define SCI_VERSION_1 SCI_VERSION_1_EARLY #define MAX_OPENED_VOLUMES 5 // Max number of simultaneously opened volumes |