From 6228d92fec3a460d17d6bc321e260bfd51b085a5 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Mon, 16 Nov 2020 09:54:18 +0100 Subject: [PATCH] solved crash for stl meshes > 2GB --- wrap/io_trimesh/import_stl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrap/io_trimesh/import_stl.h b/wrap/io_trimesh/import_stl.h index 90510e9d..11eb57c3 100644 --- a/wrap/io_trimesh/import_stl.h +++ b/wrap/io_trimesh/import_stl.h @@ -159,7 +159,7 @@ static bool IsSTLBinary(const char * filename, bool &binaryFlag) fseek(fp, STL_LABEL_SIZE, SEEK_SET); fread(&facenum, sizeof(unsigned int), 1, fp); - int expected_file_size=STL_LABEL_SIZE + 4 + (sizeof(short)+sizeof(STLFacet) )*facenum ; + long expected_file_size=STL_LABEL_SIZE + 4 + (sizeof(short)+sizeof(STLFacet) )*facenum ; if(file_size == expected_file_size) { binaryFlag = true;