summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cpal-table.hh
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cpal-table.hh')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cpal-table.hh9
1 files changed, 3 insertions, 6 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cpal-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cpal-table.hh
index ce9f76e45e9..fa7d3207be6 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cpal-table.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-color-cpal-table.hh
@@ -142,12 +142,9 @@ struct CPAL
numColors);
if (color_count)
{
- hb_array_t<const BGRAColor> segment_colors = palette_colors.sub_array (start_offset, *color_count);
- /* Always return numColors colors per palette even if it has out-of-bounds start index. */
- unsigned int count = hb_min ((unsigned) hb_max ((int) (numColors - start_offset), 0), *color_count);
- *color_count = count;
- for (unsigned int i = 0; i < count; i++)
- colors[i] = segment_colors[i]; /* Bound-checked read. */
+ + palette_colors.sub_array (start_offset, color_count)
+ | hb_sink (hb_array (colors, *color_count))
+ ;
}
return numColors;
}