mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Address feedback
This commit is contained in:
parent
76c6058abe
commit
c4652d30e2
2 changed files with 4 additions and 1 deletions
|
@ -15,6 +15,8 @@ int pngLoadPtr(const unsigned char *input_ptr, size_t input_len, int *pwidth,
|
|||
// PNG peeker - just read the start of a PNG straight into this struct, in order to
|
||||
// look at basic parameters like width and height. Note that while PNG is a chunk-based
|
||||
// format, the IHDR chunk is REQUIRED to be the first one, so this will work.
|
||||
// Does not handle Apple's weirdo extension CgBI. http://iphonedevwiki.net/index.php/CgBI_file_format
|
||||
// That should not be an issue.
|
||||
struct PNGHeaderPeek {
|
||||
uint32_t magic;
|
||||
uint32_t ignore0;
|
||||
|
|
|
@ -648,12 +648,13 @@ bool TextureReplacer::PopulateLevelFromZip(ReplacedTextureLevel &level, bool ign
|
|||
} else if (imageType == ReplacedImageType::PNG) {
|
||||
PNGHeaderPeek headerPeek;
|
||||
good = zip_fread(zf, &headerPeek, sizeof(headerPeek)) == sizeof(headerPeek);
|
||||
if (headerPeek.IsValidPNGHeader()) {
|
||||
if (good && headerPeek.IsValidPNGHeader()) {
|
||||
level.w = headerPeek.Width();
|
||||
level.h = headerPeek.Height();
|
||||
good = true;
|
||||
} else {
|
||||
ERROR_LOG(G3D, "Could not get PNG dimensions: %s (zip)", level.file.ToVisualString().c_str());
|
||||
good = false;
|
||||
}
|
||||
} else {
|
||||
ERROR_LOG(G3D, "Could not load texture replacement info: %s - unsupported format (zip)", level.file.ToVisualString().c_str());
|
||||
|
|
Loading…
Add table
Reference in a new issue