[Coverity] Fix overflow-before-widen errors

This commit is contained in:
baldurk
2018-05-08 12:15:41 +01:00
parent a45c222941
commit 3e69599da2
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -377,7 +377,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, CompType typeHint, DebugOve
idxs.resize(length);
gl.glGetBufferSubData(
eGL_ELEMENT_ARRAY_BUFFER, offset,
RDCMIN(GLsizeiptr(length - offset), GLsizeiptr(draw->numIndices * draw->indexByteWidth)),
RDCMIN(GLsizeiptr(length - offset), GLsizeiptr(draw->numIndices) * draw->indexByteWidth),
&idxs[0]);
// unbind the real index buffer
+2 -2
View File
@@ -1293,13 +1293,13 @@ void VulkanReplay::InitPostVSBuffers(uint32_t eventId)
if(vi->pVertexBindingDescriptions[vb].inputRate == VK_VERTEX_INPUT_RATE_INSTANCE)
{
len = (maxInstance + 1) * vi->pVertexBindingDescriptions[vb].stride;
len = uint64_t(maxInstance + 1) * vi->pVertexBindingDescriptions[vb].stride;
offs += drawcall->instanceOffset * vi->pVertexBindingDescriptions[vb].stride;
}
else
{
len = (maxIndex + 1) * vi->pVertexBindingDescriptions[vb].stride;
len = uint64_t(maxIndex + 1) * vi->pVertexBindingDescriptions[vb].stride;
offs += drawcall->vertexOffset * vi->pVertexBindingDescriptions[vb].stride;
}