mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-14 10:09:32 +01:00
Replacement: Verify out stride.
This commit is contained in:
1 parent
d65c7fb05e
commit
152c82e6d0
1 file changed
+5
@@ -35,6 +35,7 @@
|
||||
#include "Common/Data/Text/I18n.h"
|
||||
#include "Common/Data/Text/Parsers.h"
|
||||
#include "Common/File/FileUtil.h"
|
||||
#include "Common/LogReporting.h"
|
||||
#include "Common/StringUtils.h"
|
||||
#include "Common/Thread/ParallelLoop.h"
|
||||
#include "Common/Thread/Waitable.h"
|
||||
@@ -1262,6 +1263,10 @@ bool ReplacedTexture::Load(int level, void *out, int rowPitch) {
|
||||
|
||||
if (data.empty())
|
||||
return false;
|
||||
if (rowPitch < info.w * 4) {
|
||||
ERROR_LOG_REPORT(G3D, "Replacement rowPitch=%d, but w=%d (level=%d)", rowPitch, info.w * 4, level);
|
||||
return false;
|
||||
}
|
||||
_assert_msg_(data.size() == info.w * info.h * 4, "Data has wrong size");
|
||||
|
||||
if (rowPitch == info.w * 4) {
|
||||
|
||||
Reference in new issue
Block a user