< prev index next >

src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-font.cc

Print this page
rev 16297 : 8171248: Minor HarfBuzz fixes to pacify Coverity code scan


 247   hb_blob_t *blob;
 248 
 249   inline void init (hb_face_t *face)
 250   {
 251     this->blob = OT::Sanitizer<OT::cmap>::sanitize (face->reference_table (HB_OT_TAG_cmap));
 252     const OT::cmap *cmap = OT::Sanitizer<OT::cmap>::lock_instance (this->blob);
 253     const OT::CmapSubtable *subtable = NULL;
 254     const OT::CmapSubtableFormat14 *subtable_uvs = NULL;
 255 
 256     bool symbol = false;
 257     /* 32-bit subtables. */
 258     if (!subtable) subtable = cmap->find_subtable (3, 10);
 259     if (!subtable) subtable = cmap->find_subtable (0, 6);
 260     if (!subtable) subtable = cmap->find_subtable (0, 4);
 261     /* 16-bit subtables. */
 262     if (!subtable) subtable = cmap->find_subtable (3, 1);
 263     if (!subtable) subtable = cmap->find_subtable (0, 3);
 264     if (!subtable) subtable = cmap->find_subtable (0, 2);
 265     if (!subtable) subtable = cmap->find_subtable (0, 1);
 266     if (!subtable) subtable = cmap->find_subtable (0, 0);
 267     if (!subtable)(subtable = cmap->find_subtable (3, 0)) && (symbol = true);




 268     /* Meh. */
 269     if (!subtable) subtable = &OT::Null(OT::CmapSubtable);
 270 
 271     /* UVS subtable. */
 272     if (!subtable_uvs)
 273     {
 274       const OT::CmapSubtable *st = cmap->find_subtable (0, 5);
 275       if (st && st->u.format == 14)
 276         subtable_uvs = &st->u.format14;
 277     }
 278     /* Meh. */
 279     if (!subtable_uvs) subtable_uvs = &OT::Null(OT::CmapSubtableFormat14);
 280 
 281     this->uvs_table = subtable_uvs;
 282 
 283     this->get_glyph_data = subtable;
 284     if (unlikely (symbol))
 285       this->get_glyph_func = get_glyph_from_symbol<OT::CmapSubtable>;
 286     else
 287       switch (subtable->u.format) {




 247   hb_blob_t *blob;
 248 
 249   inline void init (hb_face_t *face)
 250   {
 251     this->blob = OT::Sanitizer<OT::cmap>::sanitize (face->reference_table (HB_OT_TAG_cmap));
 252     const OT::cmap *cmap = OT::Sanitizer<OT::cmap>::lock_instance (this->blob);
 253     const OT::CmapSubtable *subtable = NULL;
 254     const OT::CmapSubtableFormat14 *subtable_uvs = NULL;
 255 
 256     bool symbol = false;
 257     /* 32-bit subtables. */
 258     if (!subtable) subtable = cmap->find_subtable (3, 10);
 259     if (!subtable) subtable = cmap->find_subtable (0, 6);
 260     if (!subtable) subtable = cmap->find_subtable (0, 4);
 261     /* 16-bit subtables. */
 262     if (!subtable) subtable = cmap->find_subtable (3, 1);
 263     if (!subtable) subtable = cmap->find_subtable (0, 3);
 264     if (!subtable) subtable = cmap->find_subtable (0, 2);
 265     if (!subtable) subtable = cmap->find_subtable (0, 1);
 266     if (!subtable) subtable = cmap->find_subtable (0, 0);
 267     if (!subtable)
 268     {
 269       subtable = cmap->find_subtable (3, 0);
 270       if (subtable) symbol = true;
 271     }
 272     /* Meh. */
 273     if (!subtable) subtable = &OT::Null(OT::CmapSubtable);
 274 
 275     /* UVS subtable. */
 276     if (!subtable_uvs)
 277     {
 278       const OT::CmapSubtable *st = cmap->find_subtable (0, 5);
 279       if (st && st->u.format == 14)
 280         subtable_uvs = &st->u.format14;
 281     }
 282     /* Meh. */
 283     if (!subtable_uvs) subtable_uvs = &OT::Null(OT::CmapSubtableFormat14);
 284 
 285     this->uvs_table = subtable_uvs;
 286 
 287     this->get_glyph_data = subtable;
 288     if (unlikely (symbol))
 289       this->get_glyph_func = get_glyph_from_symbol<OT::CmapSubtable>;
 290     else
 291       switch (subtable->u.format) {


< prev index next >