Skip to content
Snippets Groups Projects
Commit 9f0b247c authored by Frederic L's avatar Frederic L Committed by ReinUsesLisp
Browse files

gl_shader_disk_cache: Consider compressed size zero as an error


Co-Authored-By: default avatarReinUsesLisp <reinuseslisp@airmail.cc>
parent 8ff2ce52
No related branches found
No related tags found
No related merge requests found
...@@ -59,7 +59,7 @@ std::vector<u8> CompressData(const T* source, std::size_t source_size) { ...@@ -59,7 +59,7 @@ std::vector<u8> CompressData(const T* source, std::size_t source_size) {
const int compressed_size = LZ4_compress_default(reinterpret_cast<const char*>(source), const int compressed_size = LZ4_compress_default(reinterpret_cast<const char*>(source),
reinterpret_cast<char*>(compressed.data()), reinterpret_cast<char*>(compressed.data()),
source_size_int, max_compressed_size); source_size_int, max_compressed_size);
if (compressed_size < 0) { if (compressed_size <= 0) {
// Compression failed // Compression failed
return {}; return {};
} }
...@@ -649,4 +649,4 @@ std::string ShaderDiskCacheOpenGL::GetTitleID() const { ...@@ -649,4 +649,4 @@ std::string ShaderDiskCacheOpenGL::GetTitleID() const {
return fmt::format("{:016X}", system.CurrentProcess()->GetTitleID()); return fmt::format("{:016X}", system.CurrentProcess()->GetTitleID());
} }
} // namespace OpenGL } // namespace OpenGL
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment