mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-17 12:47:46 +00:00
Merge pull request #16685 from unknownbrackets/replace-crash
Replacement: Verify out stride
This commit is contained in:
commit
71deec1d02
@ -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"
|
||||
@ -1278,6 +1279,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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user