locks up for truncated files
Brought to you by:
chulbe2lsu,
t-beu
Hello, thank you for this nice lib.
This loop will run endlessly if fread() returns zero (no more bytes in file):
https://sourceforge.net/p/matio/matio/ci/master/tree/src/inflate.c#l646
To reproduce:
wget https://github.com/libvips/libvips/raw/master/test/test-suite/images/sample.mat
head -c 10000 sample.mat > truncated.mat
Now try to load truncated.mat. Tested with 1.5.17 and 1.5.11 on WIndows and Linux.
Resolved by v1.5.18.