[Scummvm-git-logs] scummvm master -> 83cb6542dd13d8bec5580fc406cecd5b3562c43b

Strangerke noreply at scummvm.org
Tue May 6 21:10:35 UTC 2025


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

Summary:
83cb6542dd AWE: Fix PVStudio V560, V769 and V1077 in resource.cpp


Commit: 83cb6542dd13d8bec5580fc406cecd5b3562c43b
    https://github.com/scummvm/scummvm/commit/83cb6542dd13d8bec5580fc406cecd5b3562c43b
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-05-06T22:10:16+01:00

Commit Message:
AWE: Fix PVStudio V560, V769 and V1077 in resource.cpp

Changed paths:
    engines/awe/resource.cpp


diff --git a/engines/awe/resource.cpp b/engines/awe/resource.cpp
index bf50be3174d..0be0c352642 100644
--- a/engines/awe/resource.cpp
+++ b/engines/awe/resource.cpp
@@ -45,7 +45,8 @@ Resource::Resource(Video *vid, DataType dataType) :
 		_vid(vid), _dataType(dataType) {
 	if (_dataType == DT_ATARI) {
 		_amigaMemList = detectAmigaAtari();
-	}
+	} else
+		_amigaMemList = nullptr;
 }
 
 Resource::~Resource() {
@@ -526,7 +527,7 @@ uint8 *Resource::loadWav(int num, uint32 *size) {
 	default:
 		break;
 	}
-	if (p && size != nullptr) {
+	if (p) {
 		_scriptCurPtr += *size;
 		_memList[num].bufPtr = p;
 		_memList[num].status = STATUS_LOADED;
@@ -652,6 +653,9 @@ void Resource::setupPart(int ptrId) {
 
 void Resource::allocMemBlock() {
 	_memPtrStart = (uint8 *)malloc(MEM_BLOCK_SIZE);
+	if (!_memPtrStart)
+		error("allocMemBlock - Error allocating memory");
+	
 	_scriptBakPtr = _scriptCurPtr = _memPtrStart;
 	_vidCurPtr = _memPtrStart + MEM_BLOCK_SIZE - (320 * 200 / 2); // 4bpp bitmap
 	_useSegVideo2 = false;




More information about the Scummvm-git-logs mailing list