Disallow null-enabled offsets to unsized structures...
authorBehdad Esfahbod <behdad@behdad.org>
Sat, 15 Sep 2018 17:43:33 +0000 (19:43 +0200)
committerBehdad Esfahbod <behdad@behdad.org>
Sat, 15 Sep 2018 17:43:33 +0000 (19:43 +0200)
commit10642b3fbfbc1776e784b190c43a9e0693dd423a
tree85c76ac20f354e48d53bbf814d11b79416e438e5
parent9ff76c6025b55d184c96b193f23aa935ab32f1fc
Disallow null-enabled offsets to unsized structures...

...like UnsizedArrayOf<>.

This fixes a class of crasher bugs, mostly with color and AAT tables.  We
cannot use nullable offsets to varsized data that does not declare min_size,
because it's nost safe to use our fixed-size null pool for types that have
their size external.  So, use non_null'able offsets for these.

A further enhancement would be to make use of min_size in Null<> itself.
Will try that after.
12 files changed:
src/hb-aat-layout-common.hh
src/hb-aat-layout-feat-table.hh
src/hb-aat-layout-morx-table.hh
src/hb-aat-layout-trak-table.hh
src/hb-aat-ltag-table.hh
src/hb-open-type.hh
src/hb-ot-color-cbdt-table.hh
src/hb-ot-color-colr-table.hh
src/hb-ot-color-cpal-table.hh
src/hb-ot-color-svg-table.hh
src/hb-ot-layout-common.hh
src/hb-ot-layout-jstf-table.hh