Merge branch 'master' into dev
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.13)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
set(sphaira_VERSION 0.10.2)
|
set(sphaira_VERSION 0.10.3)
|
||||||
|
|
||||||
project(sphaira
|
project(sphaira
|
||||||
VERSION ${sphaira_VERSION}
|
VERSION ${sphaira_VERSION}
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ auto nro_parse_internal(fs::FsNative& fs, const fs::FsPath& path, NroEntry& entr
|
|||||||
|
|
||||||
// some .nro (vgedit) have bad nacp, fake the nacp
|
// some .nro (vgedit) have bad nacp, fake the nacp
|
||||||
if (asset.magic != NROASSETHEADER_MAGIC || asset.nacp.offset == 0 || asset.nacp.size != sizeof(entry.nacp)) {
|
if (asset.magic != NROASSETHEADER_MAGIC || asset.nacp.offset == 0 || asset.nacp.size != sizeof(entry.nacp)) {
|
||||||
|
std::memset(&asset, 0, sizeof(asset));
|
||||||
std::memset(&entry.nacp, 0, sizeof(entry.nacp));
|
std::memset(&entry.nacp, 0, sizeof(entry.nacp));
|
||||||
|
|
||||||
// get the name without the .nro
|
// get the name without the .nro
|
||||||
@@ -157,6 +158,11 @@ auto nro_scan_internal(const fs::FsPath& path, std::vector<NroEntry>& nros, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto nro_get_icon_internal(FsFile* f, u64 size, u64 offset) -> std::vector<u8> {
|
auto nro_get_icon_internal(FsFile* f, u64 size, u64 offset) -> std::vector<u8> {
|
||||||
|
// protect again really messed up sizes.
|
||||||
|
if (size > 1024 * 1024) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<u8> icon;
|
std::vector<u8> icon;
|
||||||
u64 bytes_read{};
|
u64 bytes_read{};
|
||||||
icon.resize(size);
|
icon.resize(size);
|
||||||
|
|||||||
Reference in New Issue
Block a user