diff --git a/src/ncmcrypt.cpp b/src/ncmcrypt.cpp index e2c7c73..d36fd1d 100644 --- a/src/ncmcrypt.cpp +++ b/src/ncmcrypt.cpp @@ -403,10 +403,8 @@ NeteaseCrypt::NeteaseCrypt(std::string const &path) if (n > 0) { - char *imageData = (char *)malloc(n); - read(imageData, n); - - mImageData = std::string(imageData, n); + mImageData = std::string(n, '\0'); + read(&mImageData[0], n); } else {