tiff2vips: avoid g_assert_not_reached in the default clause (#3064)

Since that could terminate the application in debug builds. Also,
add the missing case clause for `PHOTOMETRIC_MINISWHITE`.

Resolves: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51013.
This commit is contained in:
Kleis Auke Wolthuizen 2022-09-24 14:36:02 +02:00 committed by GitHub
parent db96adfc00
commit 4176ab2106
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1937,13 +1937,15 @@ rtiff_decompress_jpeg_run( Rtiff *rtiff, j_decompress_ptr cinfo,
bytes_per_pixel = 3;
break;
case PHOTOMETRIC_MINISWHITE:
case PHOTOMETRIC_MINISBLACK:
cinfo->jpeg_color_space = JCS_GRAYSCALE;
bytes_per_pixel = 1;
break;
default:
g_assert_not_reached();
cinfo->jpeg_color_space = JCS_UNKNOWN;
bytes_per_pixel = 1;
break;
}