[cpal] Port to dagger
This commit is contained in:
parent
0881611778
commit
b2d0dba5ef
|
@ -142,12 +142,9 @@ struct CPAL
|
||||||
numColors);
|
numColors);
|
||||||
if (color_count)
|
if (color_count)
|
||||||
{
|
{
|
||||||
hb_array_t<const BGRAColor> segment_colors = palette_colors.sub_array (start_offset, *color_count);
|
+ palette_colors.sub_array (start_offset, color_count)
|
||||||
/* Always return numColors colors per palette even if it has out-of-bounds start index. */
|
| hb_sink (hb_array (colors, *color_count))
|
||||||
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. */
|
|
||||||
}
|
}
|
||||||
return numColors;
|
return numColors;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue