diff --git a/Common/Render/Text/draw_text_android.cpp b/Common/Render/Text/draw_text_android.cpp index 2f55694c5a..b6ada98a94 100644 --- a/Common/Render/Text/draw_text_android.cpp +++ b/Common/Render/Text/draw_text_android.cpp @@ -77,6 +77,12 @@ std::string TextDrawerAndroid::NormalizeString(std::string str) { } void TextDrawerAndroid::MeasureString(const char *str, size_t len, float *w, float *h) { + if (!str) { + *w = 0.0; + *h = 0.0; + return; + } + CacheKey key{ std::string(str, len), fontHash_ }; TextMeasureEntry *entry; auto iter = sizeCache_.find(key); diff --git a/Core/FileSystems/BlockDevices.cpp b/Core/FileSystems/BlockDevices.cpp index cf6bcc7602..298cd45b92 100644 --- a/Core/FileSystems/BlockDevices.cpp +++ b/Core/FileSystems/BlockDevices.cpp @@ -231,7 +231,7 @@ bool CISOFileBlockDevice::ReadBlock(int blockNumber, u8 *outPtr, bool uncached) const u32 idx = index[frameNumber]; const u32 indexPos = idx & 0x7FFFFFFF; const u32 nextIndexPos = index[frameNumber + 1] & 0x7FFFFFFF; - z_stream z; + z_stream z{}; const u64 compressedReadPos = (u64)indexPos << indexShift; const u64 compressedReadEnd = (u64)nextIndexPos << indexShift; @@ -311,10 +311,7 @@ bool CISOFileBlockDevice::ReadBlocks(u32 minBlock, int count, u8 *outPtr) { const u32 afterLastIndexPos = index[lastFrameNumber + 1] & 0x7FFFFFFF; const u64 totalReadEnd = (u64)afterLastIndexPos << indexShift; - z_stream z; - z.zalloc = Z_NULL; - z.zfree = Z_NULL; - z.opaque = Z_NULL; + z_stream z{}; if (inflateInit2(&z, -15) != Z_OK) { ERROR_LOG(LOADER, "Unable to initialize inflate: %s\n", (z.msg) ? z.msg : "?"); return false; diff --git a/Core/Reporting.cpp b/Core/Reporting.cpp index 3ff8fecc44..adf72090b9 100644 --- a/Core/Reporting.cpp +++ b/Core/Reporting.cpp @@ -280,9 +280,11 @@ namespace Reporting return false; if (http.Resolve(serverHost, ServerPort())) { - http.Connect(); - int result = http.POST(http::RequestParams(uri), data, mimeType, output, &progress); - http.Disconnect(); + int result = -1; + if (http.Connect()) { + result = http.POST(http::RequestParams(uri), data, mimeType, output, &progress); + http.Disconnect(); + } return result >= 200 && result < 300; } else { diff --git a/Core/TextureReplacer.cpp b/Core/TextureReplacer.cpp index 264c6deee9..5ca2488568 100644 --- a/Core/TextureReplacer.cpp +++ b/Core/TextureReplacer.cpp @@ -456,6 +456,11 @@ bool TextureReplacer::PopulateLevel(ReplacedTextureLevel &level) { bool good = false; FILE *fp = File::OpenCFile(level.file, "rb"); + if (!fp) { + ERROR_LOG(G3D, "Error opening replacement texture file '%s'", level.file.c_str()); + return false; + } + auto imageType = Identify(fp); if (imageType == ReplacedImageType::ZIM) { fseek(fp, 4, SEEK_SET); diff --git a/GPU/Common/GPUStateUtils.cpp b/GPU/Common/GPUStateUtils.cpp index db237940fb..bdade1ea2a 100644 --- a/GPU/Common/GPUStateUtils.cpp +++ b/GPU/Common/GPUStateUtils.cpp @@ -1089,9 +1089,12 @@ void ConvertBlendState(GenericBlendState &blendState, bool allowFramebufferRead, case REPLACE_BLEND_BLUE_TO_ALPHA: blueToAlpha = true; + blendState.enabled = gstate.isAlphaBlendEnabled(); + // We'll later convert the color blend to blend in the alpha channel. break; case REPLACE_BLEND_COPY_FBO: + blendState.enabled = true; blendState.applyFramebufferRead = true; blendState.resetFramebufferRead = false; blendState.replaceAlphaWithStencil = replaceAlphaWithStencil; @@ -1099,16 +1102,17 @@ void ConvertBlendState(GenericBlendState &blendState, bool allowFramebufferRead, case REPLACE_BLEND_PRE_SRC: case REPLACE_BLEND_PRE_SRC_2X_ALPHA: + blendState.enabled = true; usePreSrc = true; break; case REPLACE_BLEND_STANDARD: case REPLACE_BLEND_2X_ALPHA: case REPLACE_BLEND_2X_SRC: + blendState.enabled = true; break; } - blendState.enabled = true; blendState.resetFramebufferRead = true; const GEBlendMode blendFuncEq = gstate.getBlendEq(); diff --git a/assets/compat.ini b/assets/compat.ini index 24f5ecbf0e..5562d4feb0 100644 --- a/assets/compat.ini +++ b/assets/compat.ini @@ -1102,6 +1102,7 @@ NPEH00029 = true ULUS10455 = true [BlueToAlpha] +# Split/Second ULES01402 = true ULUS10513 = true ULJM05812 = true