fix: read out of bound in win64 platform

This commit is contained in:
鲁树人 2024-12-20 11:02:54 +09:00
parent 2fd8f75279
commit 567fb01e79

View File

@ -33,7 +33,7 @@ class KggTask {
std::ifstream kgg_stream_in(kgg_path_, std::ios::binary); std::ifstream kgg_stream_in(kgg_path_, std::ios::binary);
char header[0x100]{}; char header[0x100]{};
kgg_stream_in.read(header, sizeof(kgg_stream_in)); kgg_stream_in.read(header, sizeof(header));
if (std::equal(kMagicHeader.cbegin(), kMagicHeader.cend(), header)) { if (std::equal(kMagicHeader.cbegin(), kMagicHeader.cend(), header)) {
warning(L"invalid kgg header"); warning(L"invalid kgg header");
return; return;