clip coding and interpretation on image read
They could be out of bounds enums. This used not to matter, but we use them more now, so out of bounds values can cause coredumps.
This commit is contained in:
parent
4b677fb16a
commit
038409093f
@ -10,6 +10,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
|
||||
|
@ -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.
|
||||
*/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user