Fix crash when plugin has missing text section (#6264)
This commit is contained in:
parent
84e54a52a6
commit
0f6478a928
|
@ -26,7 +26,8 @@
|
||||||
#include "core/loader/loader.h"
|
#include "core/loader/loader.h"
|
||||||
|
|
||||||
static std::string ReadTextInfo(FileUtil::IOFile& file, std::size_t offset, std::size_t max_size) {
|
static std::string ReadTextInfo(FileUtil::IOFile& file, std::size_t offset, std::size_t max_size) {
|
||||||
if (max_size > 0x400) { // Limit read string size to 0x400 bytes, just in case
|
if (offset == 0 || max_size == 0 ||
|
||||||
|
max_size > 0x400) { // Limit read string size to 0x400 bytes, just in case
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
std::vector<char> char_data(max_size);
|
std::vector<char> char_data(max_size);
|
||||||
|
|
Reference in New Issue