diff options
author | Frederic L <frederic.laing.development@gmail.com> | 2019-02-03 05:22:01 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-02-07 02:23:41 +0100 |
commit | d0ac62440395566f8a68a7b6d8cb2038094aba7d (patch) | |
tree | 0e9faaf8b8883321bf482923a0edb6d80e2943ab /src/video_core/renderer_opengl | |
parent | gl_shader_disk_cache: Consider compressed size zero as an error (diff) | |
download | yuzu-d0ac62440395566f8a68a7b6d8cb2038094aba7d.tar yuzu-d0ac62440395566f8a68a7b6d8cb2038094aba7d.tar.gz yuzu-d0ac62440395566f8a68a7b6d8cb2038094aba7d.tar.bz2 yuzu-d0ac62440395566f8a68a7b6d8cb2038094aba7d.tar.lz yuzu-d0ac62440395566f8a68a7b6d8cb2038094aba7d.tar.xz yuzu-d0ac62440395566f8a68a7b6d8cb2038094aba7d.tar.zst yuzu-d0ac62440395566f8a68a7b6d8cb2038094aba7d.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | 4 |
1 files changed, 4 insertions, 0 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 67fcf3061..81882822b 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp @@ -53,6 +53,10 @@ ShaderCacheVersionHash GetShaderCacheVersionHash() { template <typename T> std::vector<u8> CompressData(const T* source, std::size_t source_size) { + if (source_size > LZ4_MAX_INPUT_SIZE) { + // Source size exceeds LZ4 maximum input size + return {}; + } const auto source_size_int = static_cast<int>(source_size); const int max_compressed_size = LZ4_compressBound(source_size_int); std::vector<u8> compressed(max_compressed_size); |