From 9f0b247cf6776311d0826b0983369e9c248a6c55 Mon Sep 17 00:00:00 2001 From: Frederic L Date: Sun, 3 Feb 2019 01:21:18 -0300 Subject: [PATCH] gl_shader_disk_cache: Consider compressed size zero as an error Co-Authored-By: ReinUsesLisp --- src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp index 554d0dfb9b..67fcf3061b 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp @@ -59,7 +59,7 @@ std::vector CompressData(const T* source, std::size_t source_size) { const int compressed_size = LZ4_compress_default(reinterpret_cast(source), reinterpret_cast(compressed.data()), source_size_int, max_compressed_size); - if (compressed_size < 0) { + if (compressed_size <= 0) { // Compression failed return {}; } @@ -649,4 +649,4 @@ std::string ShaderDiskCacheOpenGL::GetTitleID() const { return fmt::format("{:016X}", system.CurrentProcess()->GetTitleID()); } -} // namespace OpenGL \ No newline at end of file +} // namespace OpenGL