Handle error values when guessing interpretation (#2421)

This commit is contained in:
Lovell Fuller 2021-08-29 20:15:24 +01:00 committed by GitHub
parent b9230edcbe
commit 30897e8e36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -578,6 +578,10 @@ vips_image_guess_interpretation( const VipsImage *image )
/* Coding overrides interpretation.
*/
switch( image->Coding ) {
case VIPS_CODING_ERROR:
sane = FALSE;
break;
case VIPS_CODING_LABQ:
if( image->Type != VIPS_INTERPRETATION_LABQ )
sane = FALSE;
@ -593,6 +597,10 @@ vips_image_guess_interpretation( const VipsImage *image )
}
switch( image->Type ) {
case VIPS_INTERPRETATION_ERROR:
sane = FALSE;
break;
case VIPS_INTERPRETATION_MULTIBAND:
/* This is a pretty useless generic tag. Always reset it.
*/