Found with #4957
Reproducer
libvips must be built with UBSAN:
meson setup build -Db_sanitize=undefined
meson compile -C build
And then the following colourspace command crashes:
./build/tools/vips black /tmp/rgb.v 8 8 --bands 3
./build/tools/vips linear /tmp/rgb.v /tmp/rgb255.v 0 255
./build/tools/vips colourspace /tmp/rgb255.v /tmp/out.v lab --source-space oklab
UBSAN output
../libvips/colour/XYZ2Lab.c:123:6: runtime error: 8.38422e+12 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../libvips/colour/XYZ2Lab.c:123:6
../libvips/colour/XYZ2Lab.c:123:6: runtime error: 8.38422e+12 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../libvips/colour/XYZ2Lab.c:123:6
../libvips/colour/XYZ2Lab.c:127:6: runtime error: 7.81401e+11 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../libvips/colour/XYZ2Lab.c:127:6
../libvips/colour/XYZ2Lab.c:127:6: runtime error: 7.81401e+11 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../libvips/colour/XYZ2Lab.c:127:6
../libvips/colour/XYZ2Lab.c:131:6: runtime error: -9.88714e+11 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../libvips/colour/XYZ2Lab.c:131:6
../libvips/colour/XYZ2Lab.c:131:6: runtime error: -9.88714e+11 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../libvips/colour/XYZ2Lab.c:131:6
Environment
- libvips master (4f2389d)
- macOS, M3 Pro (aarch64)
- Highway enabled
Found with #4957
Reproducer
libvips must be built with UBSAN:
And then the following
colourspacecommand crashes:UBSAN output
Environment