summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdftext.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-01-11 12:01:23 -0800
committerLei Zhang <thestig@chromium.org>2016-01-11 12:01:23 -0800
commit0f2ea02eb3d817993f3a5be0a5fa48f602e56483 (patch)
tree36acd17219bcbf6d6af2334b90719cbb1f789757 /fpdfsdk/src/fpdftext.cpp
parent375a86403b7fa8d17d7b142c270e2d8e33bb924f (diff)
downloadpdfium-0f2ea02eb3d817993f3a5be0a5fa48f602e56483.tar.xz
Merge to XFA: Fix an uninitalized read in FPDFText_GetFontSize().
BUG=pdfium:346 TBR=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/1578543002 . (cherry picked from commit 401cd2dbaaa10790077de2fd70e8101b0bdd0f36) Review URL: https://codereview.chromium.org/1578873002 .
Diffstat (limited to 'fpdfsdk/src/fpdftext.cpp')
-rw-r--r--fpdfsdk/src/fpdftext.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp
index c5226244f2..c745c26868 100644
--- a/fpdfsdk/src/fpdftext.cpp
+++ b/fpdfsdk/src/fpdftext.cpp
@@ -44,6 +44,7 @@ DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page) {
IPDF_TextPage* textpage = (IPDF_TextPage*)text_page;
return textpage->CountChars();
}
+
DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page,
int index) {
if (!text_page)
@@ -54,9 +55,10 @@ DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page,
return 0;
FPDF_CHAR_INFO charinfo;
- textpage->GetCharInfo(index, charinfo);
+ textpage->GetCharInfo(index, &charinfo);
return charinfo.m_Unicode;
}
+
DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page,
int index) {
if (!text_page)
@@ -67,7 +69,7 @@ DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page,
return 0;
FPDF_CHAR_INFO charinfo;
- textpage->GetCharInfo(index, charinfo);
+ textpage->GetCharInfo(index, &charinfo);
return charinfo.m_FontSize;
}
@@ -84,7 +86,7 @@ DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page,
if (index < 0 || index >= textpage->CountChars())
return;
FPDF_CHAR_INFO charinfo;
- textpage->GetCharInfo(index, charinfo);
+ textpage->GetCharInfo(index, &charinfo);
*left = charinfo.m_CharBox.left;
*right = charinfo.m_CharBox.right;
*bottom = charinfo.m_CharBox.bottom;