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

Commit 2763a4d0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add null colorspace protection" into main

parents 07deeb65 e42f93c7
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) {