Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 2ee498c

Browse files
Ethan NicholasSkia Commit-Bot
authored andcommitted
fixed uninitialized value in Perlin noise shader
Bug: skia: Change-Id: Ie1670dd574b19faa396c8db1a58cfe922925ae5a Reviewed-on: https://skia-review.googlesource.com/c/183386 Reviewed-by: Ethan Nicholas <[email protected]> Reviewed-by: Brian Salomon <[email protected]> Commit-Queue: Mike Klein <[email protected]>
1 parent f855c3c commit 2ee498c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/shaders/SkPerlinNoiseShader.cpp‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ class SkPerlinNoiseShaderImpl : public SkShaderBase {
103103
&tileVec);
104104

105105
SkSize scale;
106-
matrix.decomposeScale(&scale, nullptr);
106+
if (!matrix.decomposeScale(&scale, nullptr)) {
107+
scale.set(SK_ScalarNearlyZero, SK_ScalarNearlyZero);
108+
}
107109
fBaseFrequency.set(baseFrequencyX * SkScalarInvert(scale.width()),
108110
baseFrequencyY * SkScalarInvert(scale.height()));
109111
fTileSize.set(SkScalarRoundToInt(tileVec.fX), SkScalarRoundToInt(tileVec.fY));

0 commit comments

Comments
 (0)