Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-03-15 13:55:42 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-03-15 14:03:59 +0300
commitb435bd2f3189e3b7bfdde043442927bbd8f06116 (patch)
tree53a090c2463abe972e7c6d96a8647d22c693bc62 /source
parent59f51942655e545cef669e9fb4c9cdc9ea44f905 (diff)
Fix potential draw manager assignment to negative index
While there is an assert here, the run-time code would perform the assignment.
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/intern/draw_manager_shader.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/draw/intern/draw_manager_shader.c b/source/blender/draw/intern/draw_manager_shader.c
index 7b08f44921f..7f9a6f578b7 100644
--- a/source/blender/draw/intern/draw_manager_shader.c
+++ b/source/blender/draw/intern/draw_manager_shader.c
@@ -558,13 +558,12 @@ void DRW_shader_library_add_file(DRWShaderLibrary *lib, char *lib_code, const ch
if (index > -1) {
lib->libs[index] = lib_code;
BLI_strncpy(lib->libs_name[index], lib_name, MAX_LIB_NAME);
+ lib->libs_deps[index] = drw_shader_dependencies_get(lib, lib_code);
}
else {
printf("Error: Too many libraries. Cannot add %s.\n", lib_name);
BLI_assert(0);
}
-
- lib->libs_deps[index] = drw_shader_dependencies_get(lib, lib_code);
}
/* Return an allocN'ed string containing the shader code with its dependencies prepended.