diff options
| author | Amir Zaidi <azaidi@live.nl> | 2020-01-03 19:58:43 +0100 |
|---|---|---|
| committer | Semavi Ulusoy <doc.divxm@gmail.com> | 2022-04-22 23:34:54 +0300 |
| commit | 15ac0e9dd70dbea3dbaecc126dca77b005d67e7d (patch) | |
| tree | d5f45865093322b50178e7ee044d8298d6f60948 | |
| parent | 1c4bff873041325b9eb1a2bffb29d6aba7b0e0ad (diff) | |
IconLoader: Create new int array for hue calculation if tmp is too small
Signed-off-by: DennySPb <dennyspb@gmail.com>
Change-Id: I234f4a8426f1f8613f0f90ef942449c8204240ee
Signed-off-by: DennySPb <dennyspb@gmail.com>
| -rw-r--r-- | iconloaderlib/src/com/android/launcher3/icons/ColorExtractor.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/iconloaderlib/src/com/android/launcher3/icons/ColorExtractor.java b/iconloaderlib/src/com/android/launcher3/icons/ColorExtractor.java index 87bda82..82619cf 100644 --- a/iconloaderlib/src/com/android/launcher3/icons/ColorExtractor.java +++ b/iconloaderlib/src/com/android/launcher3/icons/ColorExtractor.java @@ -62,7 +62,7 @@ public class ColorExtractor { float highScore = -1; int bestHue = -1; - int[] pixels = mTmpPixels; + int[] pixels = mTmpPixels.length <= samples ? mTmpPixels : new int[samples]; Arrays.fill(pixels, 0); int pixelCount = 0; |
