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
diff options
context:
space:
mode:
authorlazydodo <github@lazydodo.com>2017-05-26 15:26:21 +0300
committerlazydodo <github@lazydodo.com>2017-05-26 15:26:21 +0300
commitbddd9d809d2c291eb0a92220195908c51ae2ce80 (patch)
treeb59ef35090ddfe1b42086be5beb2f9f4c3ea40e5 /source/blender/modifiers/intern/MOD_meshcache_pc2.c
parentbf5e717ef5617c597710c2836b511f9f089fcfc2 (diff)
Fix integer overflows in meshcache modifier.
Differential Revision: https://developer.blender.org/D2688
Diffstat (limited to 'source/blender/modifiers/intern/MOD_meshcache_pc2.c')
-rw-r--r--source/blender/modifiers/intern/MOD_meshcache_pc2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_meshcache_pc2.c b/source/blender/modifiers/intern/MOD_meshcache_pc2.c
index 219eae4ecca..8360c8ffda7 100644
--- a/source/blender/modifiers/intern/MOD_meshcache_pc2.c
+++ b/source/blender/modifiers/intern/MOD_meshcache_pc2.c
@@ -35,6 +35,10 @@
# include "BLI_endian_switch.h"
#endif
+#ifdef WIN32
+# include "BLI_winstuff.h"
+#endif
+
#include "MOD_meshcache_util.h" /* own include */
#include "DNA_modifier_types.h"
@@ -142,7 +146,7 @@ bool MOD_meshcache_read_pc2_index(FILE *fp,
return false;
}
- if (fseek(fp, index * pc2_head.verts_tot * sizeof(float) * 3, SEEK_CUR) != 0) {
+ if (fseek(fp, sizeof(float) * 3 * index * pc2_head.verts_tot , SEEK_CUR) != 0) {
*err_str = "Failed to seek frame";
return false;
}