Bug 1710897 - Handle matrix inversion failing more gracefully. r=aosmond

Prior to making invert() return an Option we just gleefully
assumed that it succeeded here. Instead of panicing let's
fail to create the transform.

The problem was found by oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34216

Differential Revision: https://phabricator.services.mozilla.com/D114999
This commit is contained in:
Jeff Muizelaar 2021-05-12 20:52:53 +00:00
Родитель 7891d34a05
Коммит 54a52e060a
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -873,7 +873,7 @@ fn modular_transform_create_output(out: &Profile) -> Option<Vec<Box<dyn ModularT
(&out.redTRC, &out.greenTRC, &out.blueTRC)
{
let mut transform = Box::new(MatrixTransform::default());
transform.matrix = build_colorant_matrix(out).invert().unwrap();
transform.matrix = build_colorant_matrix(out).invert()?;
transforms.push(transform);
let mut transform = Box::new(MatrixTransform::default());