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

Side by Side Diff: core/fpdfapi/fpdf_font/ttgsubtable.cpp

Issue 2032613003: Get rid of NULLs in core/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Fix a bad merge Created 4 years, 6 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 | « core/fpdfapi/fpdf_font/ttgsubtable.h ('k') | core/fpdfapi/fpdf_page/cpdf_allstates.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fpdfapi/fpdf_font/ttgsubtable.h" 7 #include "core/fpdfapi/fpdf_font/ttgsubtable.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 int i; 283 int i;
284 FT_Bytes sp = raw; 284 FT_Bytes sp = raw;
285 rec->LookupType = GetUInt16(sp); 285 rec->LookupType = GetUInt16(sp);
286 rec->LookupFlag = GetUInt16(sp); 286 rec->LookupFlag = GetUInt16(sp);
287 rec->SubTableCount = GetUInt16(sp); 287 rec->SubTableCount = GetUInt16(sp);
288 if (rec->SubTableCount <= 0) { 288 if (rec->SubTableCount <= 0) {
289 return; 289 return;
290 } 290 }
291 rec->SubTable = new struct TSubTableBase*[rec->SubTableCount]; 291 rec->SubTable = new struct TSubTableBase*[rec->SubTableCount];
292 for (i = 0; i < rec->SubTableCount; i++) { 292 for (i = 0; i < rec->SubTableCount; i++) {
293 rec->SubTable[i] = NULL; 293 rec->SubTable[i] = nullptr;
294 } 294 }
295 if (rec->LookupType != 1) { 295 if (rec->LookupType != 1) {
296 return; 296 return;
297 } 297 }
298 for (i = 0; i < rec->SubTableCount; i++) { 298 for (i = 0; i < rec->SubTableCount; i++) {
299 uint16_t offset = GetUInt16(sp); 299 uint16_t offset = GetUInt16(sp);
300 ParseSingleSubst(&raw[offset], &rec->SubTable[i]); 300 ParseSingleSubst(&raw[offset], &rec->SubTable[i]);
301 } 301 }
302 } 302 }
303 void CFX_CTTGSUBTable::ParseCoverage(FT_Bytes raw, TCoverageFormatBase** rec) { 303 void CFX_CTTGSUBTable::ParseCoverage(FT_Bytes raw, TCoverageFormatBase** rec) {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 ParseCoverage(&raw[offset], &rec->Coverage); 375 ParseCoverage(&raw[offset], &rec->Coverage);
376 rec->GlyphCount = GetUInt16(sp); 376 rec->GlyphCount = GetUInt16(sp);
377 if (rec->GlyphCount <= 0) { 377 if (rec->GlyphCount <= 0) {
378 return; 378 return;
379 } 379 }
380 rec->Substitute = new uint16_t[rec->GlyphCount]; 380 rec->Substitute = new uint16_t[rec->GlyphCount];
381 for (i = 0; i < rec->GlyphCount; i++) { 381 for (i = 0; i < rec->GlyphCount; i++) {
382 rec->Substitute[i] = GetUInt16(sp); 382 rec->Substitute[i] = GetUInt16(sp);
383 } 383 }
384 } 384 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_font/ttgsubtable.h ('k') | core/fpdfapi/fpdf_page/cpdf_allstates.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698