[Scummvm-git-logs] scummvm master -> 32ce93964018274f74999d34f1c263f462ffe73b

Strangerke noreply at scummvm.org
Thu May 22 05:14:51 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:
32ce939640 AWE: Fix PVStudio V701 in graphics_soft


Commit: 32ce93964018274f74999d34f1c263f462ffe73b
    https://github.com/scummvm/scummvm/commit/32ce93964018274f74999d34f1c263f462ffe73b
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2025-05-22T06:14:43+01:00

Commit Message:
AWE: Fix PVStudio V701 in graphics_soft

Changed paths:
    engines/awe/graphics_soft.cpp


diff --git a/engines/awe/graphics_soft.cpp b/engines/awe/graphics_soft.cpp
index 13f8793716b..b61a59619f2 100644
--- a/engines/awe/graphics_soft.cpp
+++ b/engines/awe/graphics_soft.cpp
@@ -100,10 +100,11 @@ void GraphicsSoft::setSize(int w, int h) {
 	assert(_byteDepth == 1 || _byteDepth == 2);
 
 	for (int i = 0; i < 4; ++i) {
-		_pagePtrs[i] = (uint8 *)realloc(_pagePtrs[i], getPageSize());
-		if (!_pagePtrs[i]) {
+		uint8 *tmp = (uint8 *)realloc(_pagePtrs[i], getPageSize());
+		if (!tmp) {
 			error("Not enough memory to allocate offscreen buffers");
 		}
+		_pagePtrs[i] = tmp;
 		memset(_pagePtrs[i], 0, getPageSize());
 	}
 	setWorkPagePtr(2);




More information about the Scummvm-git-logs mailing list