Skip to content

Commit c75f1a1

Browse files
committed
Clamp element size to avoid divide by 0
1 parent d5cc1cf commit c75f1a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

qrenderdoc/Windows/PipelineState/D3D12PipelineStateViewer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,9 +731,9 @@ void D3D12PipelineStateViewer::setViewDetails(RDTreeWidgetItem *node, const D3D1
731731
"elements).\n")
732732
.arg(res.byteOffset)
733733
.arg(res.byteOffset + res.byteSize)
734-
.arg(res.byteSize / res.elementByteSize)
734+
.arg(res.byteSize / qMax(1U, res.elementByteSize))
735735
.arg(buf->length)
736-
.arg(buf->length / res.elementByteSize);
736+
.arg(buf->length / qMax(1U, res.elementByteSize));
737737

738738
viewdetails = true;
739739
}

0 commit comments

Comments
 (0)