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

Side by Side Diff: core/include/fpdftext/fpdf_text.h

Issue 1578543002: Fix an uninitalized read in FPDFText_GetFontSize(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 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 | « no previous file | core/src/fpdftext/fpdf_text_int.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 #ifndef CORE_INCLUDE_FPDFTEXT_FPDF_TEXT_H_ 7 #ifndef CORE_INCLUDE_FPDFTEXT_FPDF_TEXT_H_
8 #define CORE_INCLUDE_FPDFTEXT_FPDF_TEXT_H_ 8 #define CORE_INCLUDE_FPDFTEXT_FPDF_TEXT_H_
9 9
10 #include "core/include/fpdfapi/fpdf_parser.h" 10 #include "core/include/fpdfapi/fpdf_parser.h"
(...skipping 24 matching lines...) Expand all
35 void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer, 35 void PDF_GetTextStream_Unicode(CFX_WideTextBuf& buffer,
36 CPDF_Document* pDoc, 36 CPDF_Document* pDoc,
37 CPDF_Dictionary* pPage, 37 CPDF_Dictionary* pPage,
38 FX_DWORD flags); 38 FX_DWORD flags);
39 CFX_WideString PDF_GetFirstTextLine_Unicode(CPDF_Document* pDoc, 39 CFX_WideString PDF_GetFirstTextLine_Unicode(CPDF_Document* pDoc,
40 CPDF_Dictionary* pPage); 40 CPDF_Dictionary* pPage);
41 #define CHAR_ERROR -1 41 #define CHAR_ERROR -1
42 #define CHAR_NORMAL 0 42 #define CHAR_NORMAL 0
43 #define CHAR_GENERATED 1 43 #define CHAR_GENERATED 1
44 #define CHAR_UNUNICODE 2 44 #define CHAR_UNUNICODE 2
45 typedef struct { 45
46 struct FPDF_CHAR_INFO {
46 FX_WCHAR m_Unicode; 47 FX_WCHAR m_Unicode;
47 FX_WCHAR m_Charcode; 48 FX_WCHAR m_Charcode;
48 int32_t m_Flag; 49 int32_t m_Flag;
49 FX_FLOAT m_FontSize; 50 FX_FLOAT m_FontSize;
50 FX_FLOAT m_OriginX; 51 FX_FLOAT m_OriginX;
51 FX_FLOAT m_OriginY; 52 FX_FLOAT m_OriginY;
52 CFX_FloatRect m_CharBox; 53 CFX_FloatRect m_CharBox;
53 CPDF_TextObject* m_pTextObj; 54 CPDF_TextObject* m_pTextObj;
54 CFX_Matrix m_Matrix; 55 CFX_Matrix m_Matrix;
55 } FPDF_CHAR_INFO; 56 };
57
56 typedef CFX_ArrayTemplate<CFX_FloatRect> CFX_RectArray; 58 typedef CFX_ArrayTemplate<CFX_FloatRect> CFX_RectArray;
57 #define FPDFTEXT_LRTB 0 59 #define FPDFTEXT_LRTB 0
58 #define FPDFTEXT_RLTB 1 60 #define FPDFTEXT_RLTB 1
59 #define FPDFTEXT_TBRL 2 61 #define FPDFTEXT_TBRL 2
60 #define FPDFTEXT_LEFT -1 62 #define FPDFTEXT_LEFT -1
61 #define FPDFTEXT_RIGHT 1 63 #define FPDFTEXT_RIGHT 1
62 #define FPDFTEXT_UP -2 64 #define FPDFTEXT_UP -2
63 #define FPDFTEXT_DOWN 2 65 #define FPDFTEXT_DOWN 2
64 #define FPDFTEXT_WRITINGMODE_UNKNOW 0 66 #define FPDFTEXT_WRITINGMODE_UNKNOW 0
65 #define FPDFTEXT_WRITINGMODE_LRTB 1 67 #define FPDFTEXT_WRITINGMODE_LRTB 1
(...skipping 19 matching lines...) Expand all
85 virtual FX_BOOL ParseTextPage() = 0; 87 virtual FX_BOOL ParseTextPage() = 0;
86 88
87 virtual bool IsParsed() const = 0; 89 virtual bool IsParsed() const = 0;
88 90
89 virtual int CharIndexFromTextIndex(int TextIndex) const = 0; 91 virtual int CharIndexFromTextIndex(int TextIndex) const = 0;
90 92
91 virtual int TextIndexFromCharIndex(int CharIndex) const = 0; 93 virtual int TextIndexFromCharIndex(int CharIndex) const = 0;
92 94
93 virtual int CountChars() const = 0; 95 virtual int CountChars() const = 0;
94 96
95 virtual void GetCharInfo(int index, FPDF_CHAR_INFO& info) const = 0; 97 virtual void GetCharInfo(int index, FPDF_CHAR_INFO* info) const = 0;
96 98
97 virtual void GetRectArray(int start, 99 virtual void GetRectArray(int start,
98 int nCount, 100 int nCount,
99 CFX_RectArray& rectArray) const = 0; 101 CFX_RectArray& rectArray) const = 0;
100 102
101 virtual int GetIndexAtPos(CPDF_Point point, 103 virtual int GetIndexAtPos(CPDF_Point point,
102 FX_FLOAT xTolerance, 104 FX_FLOAT xTolerance,
103 FX_FLOAT yTolerance) const = 0; 105 FX_FLOAT yTolerance) const = 0;
104 106
105 virtual int GetIndexAtPos(FX_FLOAT x, 107 virtual int GetIndexAtPos(FX_FLOAT x,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 virtual int CountLinks() const = 0; 175 virtual int CountLinks() const = 0;
174 176
175 virtual CFX_WideString GetURL(int index) const = 0; 177 virtual CFX_WideString GetURL(int index) const = 0;
176 178
177 virtual void GetBoundedSegment(int index, int& start, int& count) const = 0; 179 virtual void GetBoundedSegment(int index, int& start, int& count) const = 0;
178 180
179 virtual void GetRects(int index, CFX_RectArray& rects) const = 0; 181 virtual void GetRects(int index, CFX_RectArray& rects) const = 0;
180 }; 182 };
181 183
182 #endif // CORE_INCLUDE_FPDFTEXT_FPDF_TEXT_H_ 184 #endif // CORE_INCLUDE_FPDFTEXT_FPDF_TEXT_H_
OLDNEW
« no previous file with comments | « no previous file | core/src/fpdftext/fpdf_text_int.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698