diff options
author | jmarshallnz <jmarshallnz@svn> | 2010-03-23 23:19:38 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2010-03-23 23:19:38 +0000 |
commit | e136c5e179f197db1a9843397555aa1559517462 (patch) | |
tree | 1715ea6bc59c446a554154bb6e442a5299c28c85 | |
parent | 09553317035ba608a4afc94191bbd081677a4530 (diff) |
fixed: ensure invalid DDS images are not allocated.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@28781 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r-- | guilib/Texture.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/guilib/Texture.cpp b/guilib/Texture.cpp index ed21876bd9..988655edd4 100644 --- a/guilib/Texture.cpp +++ b/guilib/Texture.cpp @@ -154,9 +154,12 @@ bool CBaseTexture::LoadFromFile(const CStdString& texturePath, unsigned int maxW if (CUtil::GetExtension(texturePath).Equals(".dds")) { // special case for DDS images CDDSImage image; - image.ReadFile(texturePath); - Update(image.GetWidth(), image.GetHeight(), 0, image.GetFormat(), image.GetData(), false); - return true; + if (image.ReadFile(texturePath)) + { + Update(image.GetWidth(), image.GetHeight(), 0, image.GetFormat(), image.GetData(), false); + return true; + } + return false; } DllImageLib dll; |