--- old/src/java.desktop/share/native/libfreetype/src/sfnt/ttload.c 2020-08-20 13:34:04.188209237 -0700 +++ new/src/java.desktop/share/native/libfreetype/src/sfnt/ttload.c 2020-08-20 13:34:03.952209241 -0700 @@ -5,7 +5,7 @@ * Load the basic TrueType tables, i.e., tables that can be either in * TTF or OTF fonts (body). * - * Copyright (C) 1996-2019 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -397,7 +397,15 @@ } } else + { valid_entries = sfnt.num_tables; + if ( !valid_entries ) + { + FT_TRACE2(( "tt_face_load_font_dir: no valid tables found\n" )); + error = FT_THROW( Unknown_File_Format ); + goto Exit; + } + } face->num_tables = valid_entries; face->format_tag = sfnt.format_tag; @@ -916,7 +924,7 @@ /* load language tags */ { TT_LangTag entry = table->langTags; - TT_LangTag limit = entry + table->numLangTagRecords; + TT_LangTag limit = FT_OFFSET( entry, table->numLangTagRecords ); for ( ; entry < limit; entry++ )