aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Härer <markus.haerer@gmx.net>2016-07-02 17:45:29 +0200
committerMarkus Härer <markus.haerer@gmx.net>2016-07-16 23:34:00 +0200
commitffaa30649479d97d08d5c5d03f326479b135e704 (patch)
tree935dbac0cdd15fac5d1c94410df3c54117d56f18
parent1183ba3fd5c7db70cbc944189d206df262ad2253 (diff)
[fix] Fixed possible division by zero
-rw-r--r--xbmc/AutoSwitch.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/xbmc/AutoSwitch.cpp b/xbmc/AutoSwitch.cpp
index cd12746a31..e2bb56c590 100644
--- a/xbmc/AutoSwitch.cpp
+++ b/xbmc/AutoSwitch.cpp
@@ -238,5 +238,5 @@ float CAutoSwitch::MetadataPercentage(const CFileItemList &vecItems)
if(item->IsParentFolder())
total--;
}
- return (float)count / total;
+ return (total != 0) ? ((float)count / total) : 0.0f;
}