New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GameBoy ROM support #1
Comments
Comment by Techokami Awesome, I was hoping for GameBoy support! Now you just need something for an icon. Even if it's something generic. |
Comment by GerbilSoft Generic filetype icons aren't in the scope of the project. Then again, maybe that could be added later on... |
Comment by Techokami Well I mean, at least as a placeholder. Combined with the fact that some games use the exact same ROM data for all regions, and that there isn't a solid database of GameBoy cart images, would make things tricky for this platform. |
Comment by GerbilSoft Placeholders would be generic icons set in the registry and/or installed in /usr/share/icons . Returning a placeholder icon in the thumbnail generation function would cause problems later on. In any case, generic icons won't be part of the initial release. If I can get a good set at decent sizes, I'll look into adding them later. (PNG format for Linux; 256-color and 32-bit color ICO for Windows.) |
Comment by GerbilSoft This issue was moved to #1 |
1: Limit the maximum number of entries to 1,048,576. Generally there's much fewer entries, but this is a decent maximum. 2: rpcli/properties.cpp: Check that RomFields is not nullptr before using it. This means there's no fields, which happened after fixing #1 but before setting `d->isValid = false` on the failure path. It might happen at some other times too, so check it anyway, and assert on failure in debug builds.
…on error. fst is this->fst, which is nullptr at this point. This fixes a memory leak, reported by clang-9.0's AddressSanitizer.: ERROR: LeakSanitizer: detected memory leaks Direct leak of 16 byte(s) in 2 object(s) allocated from: #0 0x81511e3 in operator new(unsigned int) compiler-rt-9.0.0.src/lib/asan/asan_new_delete.cc:99:3 #1 0x84e439b in LibRomData::GcnPartitionPrivate::loadFst() src/libromdata/disc/GcnPartitionPrivate.cpp:179:25 Indirect leak of 112 byte(s) in 2 object(s) allocated from: #0 0x81511e3 in operator new(unsigned int) compiler-rt-9.0.0.src/lib/asan/asan_new_delete.cc:99:3 #1 0x8571151 in LibRomData::GcnFst::GcnFst(unsigned char const*, unsigned int, unsigned char) src/libromdata/disc/GcnFst.cpp:377:6
Crash #1 was caused by using the header's image count instead of the actual vector size. A corrupted (or maliciously crafted) WIM XML file could have an incorrect image count field. This crashes in the second half of the XML parsing when processing the vector, since the index goes out of bounds. Fix this by using a ranged-based `for` loop using the vector, and maintain an index count separately. Crash #2 was caused by not limiting the image count to a reasonable maximum. A fuzzed value of 2147483650 caused an std::bad_alloc when calling std::vector<>::reserve(). Other changes: - Use a constant for the maximum image size. - Get rid of the rowloop macros. Found using aflplusplus-4.07c.
Not currently used... Palette order matches the bits used in multi-color sprites: - 0: Transparent - 1: Multicolor register #0 ($D025) - 2: Sprite color register - 3: Multicolor register #1 ($D026)
Issue by DankRank
Thursday Sep 01, 2016 at 17:52 GMT
Originally opened as https://github.com/GerbilSoft/rom-properties.reworking/pull/1
Added support for GameBoy ROMs (includes GameBoy Color and Super GameBoy)
DankRank included the following code: https://github.com/GerbilSoft/rom-properties.reworking/pull/1/commits
The text was updated successfully, but these errors were encountered: