mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-24 01:09:20 -07:00
Additional check to return a friendly error when binary STL is not valid
This commit is contained in:
@@ -22,6 +22,7 @@ sub read_file {
|
||||
seek $fh, 80, 0;
|
||||
read $fh, my $buf, 4;
|
||||
my $triangle_count = unpack 'L', $buf;
|
||||
die "STL file seems invalid, could not read facet count\n" if !defined $triangle_count;
|
||||
my $expected_size =
|
||||
+ 80 # header
|
||||
+ 4 # count
|
||||
|
||||
Reference in New Issue
Block a user