From e292f0cc9ba2c6516f958f88bccd6437c2d92320 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Fri, 12 Feb 2021 17:48:34 +0100 Subject: [PATCH] fix malformed file on some stl files (see https://github.com/cnr-isti-vclab/meshlab/issues/732) --- 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 11eb57c3..2a202098 100644 --- a/wrap/io_trimesh/import_stl.h +++ b/wrap/io_trimesh/import_stl.h @@ -150,7 +150,7 @@ static bool IsSTLColored(const char * filename, bool &coloredFlag, bool &magicsM static bool IsSTLBinary(const char * filename, bool &binaryFlag) { binaryFlag=false; - FILE *fp = fopen(filename, "r"); + FILE *fp = fopen(filename, "rb"); /* Find size of file */ fseek(fp, 0, SEEK_END); long file_size = ftell(fp);