Skip to content

Commit

Permalink
PRINCE: PtcArchive::createReadStreamFromMember - add MKTAG
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaslw committed Oct 6, 2014
1 parent a9d9696 commit 4ef22e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions engines/prince/archive.cpp
Expand Up @@ -123,13 +123,13 @@ Common::SeekableReadStream *PtcArchive::createReadStreamForMember(const Common::
_stream->seek(entryHeader._offset);

// This *HAS* to be malloc (not new[]) because MemoryReadStream uses free() to free the memory
byte* buffer = (byte *)malloc(size);
byte *buffer = (byte *)malloc(size);
_stream->read(buffer, size);

if (READ_BE_UINT32(buffer) == 0x4D41534D) {
if (READ_BE_UINT32(buffer) == MKTAG('M', 'A', 'S', 'M')) {
Decompressor dec;
uint32 decompLen = READ_BE_UINT32(buffer + 14);
byte *decompData = (byte*)malloc(decompLen);
byte *decompData = (byte *)malloc(decompLen);
dec.decompress(buffer + 18, decompData, decompLen);
free(buffer);
size = decompLen;
Expand Down

0 comments on commit 4ef22e3

Please sign in to comment.