mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
[Coverity] Fix some possible divide by 0 cases
This commit is contained in:
@@ -161,7 +161,7 @@ namespace renderdoc
|
||||
// Get instance fields of the structure type.
|
||||
FieldInfo[] fieldInfo = NonArrayType(field.FieldType).GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
|
||||
|
||||
int align = 0;
|
||||
int align = 1;
|
||||
|
||||
foreach (FieldInfo f in fieldInfo)
|
||||
align = Math.Max(align, AlignOf(f));
|
||||
@@ -290,7 +290,7 @@ namespace renderdoc
|
||||
|
||||
long size = 0;
|
||||
|
||||
int a = 0;
|
||||
int a = 1;
|
||||
|
||||
foreach (FieldInfo field in fieldInfo)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace renderdocui.Windows
|
||||
|
||||
private int SliceForString(string s, UInt32 value, UInt32 maximum)
|
||||
{
|
||||
if (value == 0)
|
||||
if (value == 0 || maximum == 0)
|
||||
return 0;
|
||||
|
||||
float ratio = (float)value / maximum;
|
||||
|
||||
Reference in New Issue
Block a user