diff --git a/.gitignore b/.gitignore index c7101f3a..988de944 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +fuzz/ .pytest_cache compile .pytest_cache diff --git a/ChangeLog b/ChangeLog index fc5c9b75..f9c9f828 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,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 diff --git a/libvips/foreign/ppm.c b/libvips/foreign/ppm.c index a5022e78..d5d1a626 100644 --- a/libvips/foreign/ppm.c +++ b/libvips/foreign/ppm.c @@ -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 ) ; }