Merge "Fix crash when quantizing" into sc-dev

This commit is contained in:
James O'Leary
2021-03-12 21:15:26 +00:00
committed by Android (Google) Code Review

View File

@@ -75,7 +75,7 @@ public class WSMeansQuantizer implements Quantizer {
// Note: they don't _have_ to be ignored, for example, we could instead turn them // Note: they don't _have_ to be ignored, for example, we could instead turn them
// opaque. Traditionally, including outside Android, quantizers ignore transparent // opaque. Traditionally, including outside Android, quantizers ignore transparent
// pixels, so that strategy was chosen. // pixels, so that strategy was chosen.
int alpha = (pixel >> 24); int alpha = (pixel >> 24) & 0xff;
if (alpha < 255) { if (alpha < 255) {
continue; continue;
} }