diff --git a/ChangeLog b/ChangeLog index fb50c598..8596644a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,7 @@ - fix a problem with shinkv tail processing [angelmixu] - fix a read one byte beyond buffer bug in jpegload - make GIF parsing less strict +- clip coding and interpretation on vips image read 24/5/19 started 8.8.1 - improve realpath() use on older libc diff --git a/libvips/iofuncs/vips.c b/libvips/iofuncs/vips.c index 83988c78..4e35023b 100644 --- a/libvips/iofuncs/vips.c +++ b/libvips/iofuncs/vips.c @@ -382,8 +382,10 @@ vips__read_header_bytes( VipsImage *im, unsigned char *from ) im->Ysize = VIPS_CLIP( 1, im->Ysize, VIPS_MAX_COORD ); im->Bands = VIPS_CLIP( 1, im->Bands, VIPS_MAX_COORD ); im->BandFmt = VIPS_CLIP( 0, im->BandFmt, VIPS_FORMAT_LAST - 1 ); + im->Type = VIPS_CLIP( 0, im->Type, VIPS_INTERPRETATION_LAST - 1 ); + im->Coding = VIPS_CLIP( 0, im->Coding, VIPS_CODING_LAST - 1 ); - /* Type, Coding, Offset, Res, etc. don't affect vips file layout, just + /* Offset, Res, etc. don't affect vips file layout, just * pixel interpretation, don't clip them. */