Commit 92480316 authored by Behdad Esfahbod's avatar Behdad Esfahbod
Browse files

[colr] Check layer record access

Showing with 8 additions and 1 deletion
+8 -1
......@@ -110,13 +110,20 @@ struct COLR
return true;
}
inline void get_layer_record (unsigned int record,
inline bool get_layer_record (unsigned int record,
hb_codepoint_t *glyph_id /* OUT */,
unsigned int *palette_index /* OUT */) const
{
if (unlikely (record >= numLayers))
{
*glyph_id = 0;
*palette_index = 0xFFFF;
return false;
}
const LayerRecord &layer = (this+layersZ)[record];
*glyph_id = layer.glyphid;
*palette_index = layer.colorIdx;
return true;
}
protected:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment