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

Unified Diff: fpdfsdk/src/fpdftext.cpp

Issue 1578873002: Merge to XFA: Fix an uninitalized read in FPDFText_GetFontSize(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdftext/text_int.h ('k') | fpdfsdk/src/fpdftext_embeddertest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdftext.cpp
diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp
index c5226244f2c0a868a1257df096e3d75b9ac06f66..c745c268686d8594db38328555449978bea8d5fa 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;
« no previous file with comments | « core/src/fpdftext/text_int.h ('k') | fpdfsdk/src/fpdftext_embeddertest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698