summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorFrederic L <frederic.laing.development@gmail.com>2019-02-03 05:22:01 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-02-07 02:23:41 +0100
commitd0ac62440395566f8a68a7b6d8cb2038094aba7d (patch)
tree0e9faaf8b8883321bf482923a0edb6d80e2943ab /src/video_core
parentgl_shader_disk_cache: Consider compressed size zero as an error (diff)
downloadyuzu-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')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_disk_cache.cpp4
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);