[Scummvm-git-logs] scummvm master -> 066c3ff2ea7a7018920af305b6900a4fbc06ce03

aquadran noreply at scummvm.org
Mon Oct 14 11:37:36 UTC 2024


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

Summary:
066c3ff2ea WINTERMUTE: Coverity silince CID: 1563753, 1563764


Commit: 066c3ff2ea7a7018920af305b6900a4fbc06ce03
    https://github.com/scummvm/scummvm/commit/066c3ff2ea7a7018920af305b6900a4fbc06ce03
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2024-10-14T13:37:30+02:00

Commit Message:
WINTERMUTE: Coverity silince CID: 1563753, 1563764

Changed paths:
    engines/wintermute/base/gfx/xskinmesh.cpp


diff --git a/engines/wintermute/base/gfx/xskinmesh.cpp b/engines/wintermute/base/gfx/xskinmesh.cpp
index 28d8d4ec6e4..ac3a2374024 100644
--- a/engines/wintermute/base/gfx/xskinmesh.cpp
+++ b/engines/wintermute/base/gfx/xskinmesh.cpp
@@ -680,10 +680,12 @@ static bool parseDeclData(XFileData &fileData, struct MeshData *meshData) {
 		case DXDECLUSAGE_NORMAL:
 			assert(!(meshData->_fvf & DXFVF_NORMAL));
 			normalOffset = vertexSize;
+			meshData->_fvf |= DXFVF_NORMAL;
 			break;
 		case DXDECLUSAGE_TEXCOORD:
 			assert(!(meshData->_fvf & DXFVF_TEX1));
 			textureOffset = vertexSize;
+			meshData->_fvf |= DXFVF_TEX1;
 			break;
 		case DXDECLUSAGE_TANGENT:
 			//tangentOffset = vertexSize;
@@ -710,7 +712,7 @@ static bool parseDeclData(XFileData &fileData, struct MeshData *meshData) {
 		return false;
 	}
 
-	if (normalOffset != (uint32)-1) {
+	if (meshData->_fvf & DXFVF_NORMAL) {
 		if (!meshData->_indices)
 			return false;
 		delete[] meshData->_normals;
@@ -722,16 +724,14 @@ static bool parseDeclData(XFileData &fileData, struct MeshData *meshData) {
 			return false;
 		}
 		memcpy(meshData->_normalIndices, meshData->_indices, numFaceIndices * sizeof(uint32));
-		meshData->_fvf |= DXFVF_NORMAL;
 	}
 
-	if (textureOffset != (uint32)-1) {
+	if (meshData->_fvf & DXFVF_TEX1) {
 		delete[] meshData->_texCoords;
 		meshData->_texCoords = new DXVector2[meshData->_numVertices];
 		if (!meshData->_texCoords) {
 			return false;
 		}
-		meshData->_fvf |= DXFVF_TEX1;
 	}
 
 	for (i = 0; i < meshData->_numVertices; ++i) {




More information about the Scummvm-git-logs mailing list