fix loop with malformed ppm

skip_line in ppm parse was not testing for EOF, so it could get stuck
with malformed files

thanks Kyle-Kyle

see https://github.com/libvips/libvips/issues/1377
This commit is contained in:
John Cupitt 2019-07-29 10:05:55 +01:00
parent 3510e7abcf
commit 5e77ab948b
3 changed files with 6 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
fuzz/
.pytest_cache
compile
.pytest_cache

View File

@ -2,6 +2,7 @@
- better early shutdown in readers
- don't attempt to save large XMP to jpeg [tnextday]
- always fetch HEIC metadata from the main image [zhoux2016]
- fix loop in malformed ppm [Kyle-Kyle]
24/5/19 started 8.8.1
- improve realpath() use on older libc

View File

@ -89,7 +89,10 @@
static void
skip_line( FILE *fp )
{
while( vips__fgetc( fp ) != '\n' )
int ch;
while( (ch = vips__fgetc( fp )) != '\n' &&
ch != EOF )
;
}