diff options
author | jmarshallnz <jmarshallnz@svn> | 2009-10-24 04:10:46 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2009-10-24 04:10:46 +0000 |
commit | fe1b89e5141bc2195da79b8c10cf69eee4756b3b (patch) | |
tree | 4552819a441a9f5baa6b82083b43c73896f865d1 /guilib | |
parent | ca447e27f23176e0a4c652bba0440378dea7138b (diff) |
fixed: Possible divide by zero in the progress control.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@23956 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib')
-rw-r--r-- | guilib/GUIProgressControl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/guilib/GUIProgressControl.cpp b/guilib/GUIProgressControl.cpp index b491a06747..8a0477562c 100644 --- a/guilib/GUIProgressControl.cpp +++ b/guilib/GUIProgressControl.cpp @@ -75,18 +75,19 @@ void CGUIProgressControl::Render() if (m_fPercent < 0.0f) m_fPercent = 0.0f; if (m_fPercent > 100.0f) m_fPercent = 100.0f; - float fScaleX, fScaleY; if (m_width == 0) m_width = m_guiBackground.GetTextureWidth(); if (m_height == 0) m_height = m_guiBackground.GetTextureHeight(); - fScaleY = m_height / m_guiBackground.GetTextureHeight(); - fScaleX = m_width / m_guiBackground.GetTextureWidth(); m_guiBackground.SetHeight(m_height); m_guiBackground.SetWidth(m_width); m_guiBackground.Render(); + float fScaleX, fScaleY; + fScaleY = m_guiBackground.GetTextureHeight() ? m_height / m_guiBackground.GetTextureHeight() : 1.0f; + fScaleX = m_guiBackground.GetTextureWidth() ? m_width / m_guiBackground.GetTextureWidth() : 1.0f; + float fWidth = m_fPercent; float posX = m_guiBackground.GetXPosition(); |