Bug 1678019 - Re-add handling of lut creation failure. r=aosmond
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Wed, 18 Nov 2020 15:02:52 +0000
changeset 557807 3b8ca204882f29dad4734e38186362790d60928c
parent 557806 fc06dd6899fc727d31610f98a5d0eda989164c8a
child 557808 561b182ae314ca60c36b20fbe4e79b6a48328085
push id37962
push userapavel@mozilla.com
push dateWed, 18 Nov 2020 21:51:58 +0000
treeherdermozilla-central@9d797387f57c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond
bugs1678019, 27601
milestone85.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1678019 - Re-add handling of lut creation failure. r=aosmond This was found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27601 and caused by 1f9a32185f4c1d2abfe1e32d773505d865541ad7 Differential Revision: https://phabricator.services.mozilla.com/D97446
gfx/qcms/src/transform.rs
--- a/gfx/qcms/src/transform.rs
+++ b/gfx/qcms/src/transform.rs
@@ -1241,16 +1241,18 @@ fn qcms_transform_precacheLUT_float(
             if in_type == QCMS_DATA_RGBA_8 {
                 (*transform).transform_fn = Some(qcms_transform_data_tetra_clut_rgba)
             } else if in_type == QCMS_DATA_BGRA_8 {
                 (*transform).transform_fn = Some(qcms_transform_data_tetra_clut_bgra)
             } else if in_type == QCMS_DATA_RGB_8 {
                 (*transform).transform_fn = Some(qcms_transform_data_tetra_clut_rgb)
             }
             debug_assert!((*transform).transform_fn.is_some());
+        } else {
+            return null_mut();
         }
     }
     return Box::into_raw(transform);
 }
 #[no_mangle]
 pub extern "C" fn qcms_transform_create(
     mut in_0: &qcms_profile,
     mut in_type: qcms_data_type,