Skip to content

[mm] Delay setting blend weight and design position

Ben Wagner requested to merge bungeman/freetype:init_mm into master

Previously the blend->weight_vector, blend->default_weight_vector, and blend->design_pos were set early to allocated but uninitialized memory under the assumption that the memory would eventually be initialized. However, it is possible that some of the required keywords may not actually be present, leaving the memory uninitialized. This is different from a present but invalid table, which would produce an error.

  • src/type1/t1load.c (t1_allocate_blend): remove early allocation and initialization. (parse_blend_design_positions, parse_weight_vector): parse into local and assign to blend if valid. (T1_Open_Face): check that if a blend exists that it has the weight vector and design positions.

Merge request reports