[Scummvm-git-logs] scummvm master -> 282ad5a719bbed19a15481271e661032f64c6d84

fracturehill noreply at scummvm.org
Mon Jul 29 19:59:52 UTC 2024


This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
10f5465991 NANCY: Fix an alloc-dealloc mismatch in cif.cpp
bf61247bc5 NANCY: Fix an alloc-dealloc mismatch in commontypes.cpp
de4f8ca634 NANCY: Fix an alloc-dealloc mismatch in iff.cpp
282ad5a719 NANCY: Fix an alloc-dealloc mismatch in cif.cpp


Commit: 10f54659911d0e2369e440a79fe916643eb54c71
    https://github.com/scummvm/scummvm/commit/10f54659911d0e2369e440a79fe916643eb54c71
Author: scummvmuser (150493071+scummvmuser at users.noreply.github.com)
Date: 2024-07-29T21:59:48+02:00

Commit Message:
NANCY: Fix an alloc-dealloc mismatch in cif.cpp

CifTree::createReadStreamForMember's `buf` is free()d by way of
Common::DisposablePtr<unsigned char const,
    Common::MemoryReadStream::CastFreeDeleter>::~DisposablePtr()

Changed paths:
    engines/nancy/cif.cpp


diff --git a/engines/nancy/cif.cpp b/engines/nancy/cif.cpp
index 6c570625cd3..97fdf63e2db 100644
--- a/engines/nancy/cif.cpp
+++ b/engines/nancy/cif.cpp
@@ -215,7 +215,7 @@ Common::SeekableReadStream *CifTree::createReadStreamForMember(const Common::Pat
 	}
 
 	const CifInfo &info = _fileMap[path];
-	byte *buf = new byte[info.size];
+	byte *buf = (byte *)malloc(info.size);
 
 	bool success = true;
 
@@ -237,7 +237,8 @@ Common::SeekableReadStream *CifTree::createReadStreamForMember(const Common::Pat
 
 	if (!success) {
 		warning("Failed to read data for '%s' from CifTree '%s'", info.name.toString().c_str(), _name.toString().c_str());
-		delete[] buf;
+		free(buf);
+		buf = nullptr;
 		_stream->clearErr();
 		return nullptr;
 	}


Commit: bf61247bc5b3f1b69ca9e858b6c5f44c856b2e63
    https://github.com/scummvm/scummvm/commit/bf61247bc5b3f1b69ca9e858b6c5f44c856b2e63
Author: scummvmuser (150493071+scummvmuser at users.noreply.github.com)
Date: 2024-07-29T21:59:48+02:00

Commit Message:
NANCY: Fix an alloc-dealloc mismatch in commontypes.cpp

StaticData::readData's `patchBuf` is free()d by way of
Common::DisposablePtr<unsigned char const,
    Common::MemoryReadStream::CastFreeDeleter>::~DisposablePtr()

Changed paths:
    engines/nancy/commontypes.cpp


diff --git a/engines/nancy/commontypes.cpp b/engines/nancy/commontypes.cpp
index 3cb6f2b0ee5..ed5747bd30f 100644
--- a/engines/nancy/commontypes.cpp
+++ b/engines/nancy/commontypes.cpp
@@ -563,7 +563,7 @@ void StaticData::readData(Common::SeekableReadStream &stream, Common::Language l
 		case MKTAG('P', 'A', 'T', 'C') :
 			// Patch file
 			patchBufSize = nextSectionOffset - stream.pos();
-			patchBuf = new byte[patchBufSize];
+			patchBuf = (byte *)malloc(patchBufSize);
 			stream.read(patchBuf, patchBufSize);
 			break;
 		case MKTAG('P', 'A', 'S', 'S') :


Commit: de4f8ca634b7ad85c5852d7b93cc74d2e92a863f
    https://github.com/scummvm/scummvm/commit/de4f8ca634b7ad85c5852d7b93cc74d2e92a863f
Author: scummvmuser (150493071+scummvmuser at users.noreply.github.com)
Date: 2024-07-29T21:59:48+02:00

Commit Message:
NANCY: Fix an alloc-dealloc mismatch in iff.cpp

IFF::getChunkStream's `dup` is free()d by way of
Common::DisposablePtr<unsigned char const,
    Common::MemoryReadStream::CastFreeDeleter>::~DisposablePtr()

Changed paths:
    engines/nancy/iff.cpp


diff --git a/engines/nancy/iff.cpp b/engines/nancy/iff.cpp
index 615fc22d559..dc8b8e95923 100644
--- a/engines/nancy/iff.cpp
+++ b/engines/nancy/iff.cpp
@@ -111,7 +111,7 @@ Common::SeekableReadStream *IFF::getChunkStream(const Common::String &id, uint i
 	const byte *chunk = getChunk(stringToId(id), size, index);
 
 	if (chunk) {
-		byte *dup = new byte[size];
+		byte *dup = (byte *)malloc(size);
 		memcpy(dup, chunk, size);
 		return new Common::MemoryReadStream(dup, size, DisposeAfterUse::YES);
 	}


Commit: 282ad5a719bbed19a15481271e661032f64c6d84
    https://github.com/scummvm/scummvm/commit/282ad5a719bbed19a15481271e661032f64c6d84
Author: scummvmuser (150493071+scummvmuser at users.noreply.github.com)
Date: 2024-07-29T21:59:48+02:00

Commit Message:
NANCY: Fix an alloc-dealloc mismatch in cif.cpp

CifFile::createReadStream's `buf` is free()d by way of
Common::DisposablePtr<unsigned char const,
    Common::MemoryReadStream::CastFreeDeleter>::~DisposablePtr()

Changed paths:
    engines/nancy/cif.cpp


diff --git a/engines/nancy/cif.cpp b/engines/nancy/cif.cpp
index 97fdf63e2db..6fc1edad89d 100644
--- a/engines/nancy/cif.cpp
+++ b/engines/nancy/cif.cpp
@@ -105,7 +105,7 @@ CifFile::~CifFile() {
 }
 
 Common::SeekableReadStream *CifFile::createReadStream() const {
-	byte *buf = new byte[_info.size];
+	byte *buf = (byte *)malloc(_info.size);
 
 	bool success = true;
 
@@ -127,7 +127,8 @@ Common::SeekableReadStream *CifFile::createReadStream() const {
 
 	if (!success) {
 		warning("Failed to read data for CifFile '%s'", _info.name.toString().c_str());
-		delete[] buf;
+		free(buf);
+		buf = nullptr;
 		_stream->clearErr();
 		return nullptr;
 	}




More information about the Scummvm-git-logs mailing list