Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: src/gsub.cc

Issue 139353002: Fix offset verification in GDEF and GSUB header parsing. (Closed) Base URL: https://chromium.googlesource.com/external/ots.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gdef.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gsub.h" 5 #include "gsub.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <vector> 8 #include <vector>
9 9
10 #include "gdef.h" 10 #include "gdef.h"
11 #include "gpos.h" 11 #include "gpos.h"
12 #include "layout.h" 12 #include "layout.h"
13 #include "maxp.h" 13 #include "maxp.h"
14 14
15 // GSUB - The Glyph Substitution Table 15 // GSUB - The Glyph Substitution Table
16 // http://www.microsoft.com/typography/otspec/gsub.htm 16 // http://www.microsoft.com/typography/otspec/gsub.htm
17 17
18 namespace { 18 namespace {
19 19
20 // The GSUB header size 20 // The GSUB header size
21 const size_t kGsubHeaderSize = 8; 21 const size_t kGsubHeaderSize = 4 + 3 * 2;
22 22
23 enum GSUB_TYPE { 23 enum GSUB_TYPE {
24 GSUB_TYPE_SINGLE = 1, 24 GSUB_TYPE_SINGLE = 1,
25 GSUB_TYPE_MULTIPLE = 2, 25 GSUB_TYPE_MULTIPLE = 2,
26 GSUB_TYPE_ALTERNATE = 3, 26 GSUB_TYPE_ALTERNATE = 3,
27 GSUB_TYPE_LIGATURE = 4, 27 GSUB_TYPE_LIGATURE = 4,
28 GSUB_TYPE_CONTEXT = 5, 28 GSUB_TYPE_CONTEXT = 5,
29 GSUB_TYPE_CHANGING_CONTEXT = 6, 29 GSUB_TYPE_CHANGING_CONTEXT = 6,
30 GSUB_TYPE_EXTENSION_SUBSTITUTION = 7, 30 GSUB_TYPE_EXTENSION_SUBSTITUTION = 7,
31 GSUB_TYPE_REVERSE_CHAINING_CONTEXT_SINGLE = 8, 31 GSUB_TYPE_REVERSE_CHAINING_CONTEXT_SINGLE = 8,
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 665
666 return true; 666 return true;
667 } 667 }
668 668
669 void ots_gsub_free(OpenTypeFile *file) { 669 void ots_gsub_free(OpenTypeFile *file) {
670 delete file->gsub; 670 delete file->gsub;
671 } 671 }
672 672
673 } // namespace ots 673 } // namespace ots
674 674
OLDNEW
« no previous file with comments | « src/gdef.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698