summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/HiresTextures.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoCommon/HiresTextures.cpp')
-rw-r--r--Source/Core/VideoCommon/HiresTextures.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/HiresTextures.cpp b/Source/Core/VideoCommon/HiresTextures.cpp
index b03b489305..5d177a0257 100644
--- a/Source/Core/VideoCommon/HiresTextures.cpp
+++ b/Source/Core/VideoCommon/HiresTextures.cpp
@@ -417,13 +417,17 @@ std::unique_ptr<HiresTexture> HiresTexture::Load(const std::string& base_filenam
break;
}
- // calculate the size of the next mipmap
- width >>= 1;
- height >>= 1;
-
if (!ret)
ret = std::unique_ptr<HiresTexture>(new HiresTexture);
ret->m_levels.push_back(std::move(l));
+
+ // no more mipmaps available
+ if (width == 1 && height == 1)
+ break;
+
+ // calculate the size of the next mipmap
+ width = std::max(1u, width >> 1);
+ height = std::max(1u, height >> 1);
}
else
{