[subset] fix data race touching Crap() in cff subsetting.

pull/3627/head
Garret Rieger 3 years ago committed by Behdad Esfahbod
parent d8d96b26e7
commit 98aaecd397
  1. 3
      src/hb-ot-cff1-table.hh
  2. 3
      src/hb-subset-cff-common.hh
  3. 2
      test/threads/hb-subset-threads.cc

@ -1138,7 +1138,8 @@ struct cff1
cff1_top_dict_interp_env_t env (fontDictStr); cff1_top_dict_interp_env_t env (fontDictStr);
cff1_font_dict_interpreter_t font_interp (env); cff1_font_dict_interpreter_t font_interp (env);
font = fontDicts.push (); font = fontDicts.push ();
if (unlikely (font == &Crap (cff1_font_dict_values_t))) { fini (); return; } if (unlikely (fontDicts.in_error ())) { fini (); return; }
font->init (); font->init ();
if (unlikely (!font_interp.interpret (*font))) { fini (); return; } if (unlikely (!font_interp.interpret (*font))) { fini (); return; }
PRIVDICTVAL *priv = &privateDicts[i]; PRIVDICTVAL *priv = &privateDicts[i];

@ -44,7 +44,8 @@ struct str_encoder_t
void encode_byte (unsigned char b) void encode_byte (unsigned char b)
{ {
if (unlikely (buff.push (b) == &Crap (unsigned char))) buff.push (b);
if (unlikely (buff.in_error ()))
set_error (); set_error ();
} }

@ -159,7 +159,7 @@ int main(int argc, char** argv)
if (argc > 4) if (argc > 4)
{ {
num_tests = (argc - 3) / 2; num_tests = argc - 3;
tests = (test_input_t *) calloc (num_tests, sizeof (test_input_t)); tests = (test_input_t *) calloc (num_tests, sizeof (test_input_t));
for (unsigned i = 0; i < num_tests; i++) for (unsigned i = 0; i < num_tests; i++)
{ {

Loading…
Cancel
Save