diff --git a/GPU/Common/ReplacedTexture.cpp b/GPU/Common/ReplacedTexture.cpp index 6d2dfa05dd..79c1c80e21 100644 --- a/GPU/Common/ReplacedTexture.cpp +++ b/GPU/Common/ReplacedTexture.cpp @@ -16,7 +16,6 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include -#include #include "ppsspp_config.h" @@ -722,15 +721,7 @@ ReplacedTexture::LoadLevelResult ReplacedTexture::LoadLevelData(VFSFileReference png.format = PNG_FORMAT_RGBA; std::vector &out = data_[mipLevel]; - const size_t width = (size_t)level.w; - const size_t height = (size_t)level.h; - if (level.w <= 0 || level.h <= 0 || - width > std::numeric_limits::max() / height || - width * height > std::numeric_limits::max() / 4) { - ERROR_LOG(Log::TexReplacement, "PNG replacement dimensions are too large: %s (%dx%d)", filename.c_str(), level.w, level.h); - return LoadLevelResult::LOAD_ERROR; - } - out.resize(width * height * 4); + out.resize(level.w * level.h * 4); if (!png_image_finish_read(&png, nullptr, &out[0], level.w * 4, nullptr)) { ERROR_LOG(Log::TexReplacement, "Could not load texture replacement: %s - %s", filename.c_str(), png.message); out.resize(0);