Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e42f93c7 authored by John Reck's avatar John Reck
Browse files

Add null colorspace protection

Fixes: 367272642
Test: none
Flag: EXEMPT bugfix
Change-Id: I6831512e799df9025a91d768094a1862802803e4
parent feff969e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -619,8 +619,11 @@ bool SkiaCanvas::useGainmapShader(Bitmap& bitmap) {
    // If it's an unknown colortype then it's not a bitmap-backed canvas
    if (info.colorType() == SkColorType::kUnknown_SkColorType) return true;

    auto colorSpace = info.colorSpace();
    // If we don't have a colorspace, we can't apply a gainmap
    if (!colorSpace) return false;
    skcms_TransferFunction tfn;
    info.colorSpace()->transferFn(&tfn);
    colorSpace->transferFn(&tfn);

    auto transferType = skcms_TransferFunction_getType(&tfn);
    switch (transferType) {