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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 848073003: PDF: Yet another stab at getting WriteInto() buffer sizes correct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix accessibility code that can no longer occur Created 5 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 | « no previous file | pdf/pdfium/pdfium_page.cc » ('j') | pdf/pdfium/pdfium_page.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 228a8899cc4f5436c1ca4b7f7015ce40e68d05da..6d828a44f6fa4590f499b97276a21061f7d55cda 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -2076,10 +2076,12 @@ void PDFiumEngine::SearchUsingICU(const base::string16& term,
character_to_start_searching_from,
text_length,
data);
- if (written < 1)
- page_text.resize(0);
- else
+ if (written > 0) {
+ DCHECK_EQ(L'\0', page_text[written - 1]);
page_text.resize(written - 1);
+ } else {
+ page_text.clear();
+ }
std::vector<PDFEngine::Client::SearchStringResult> results;
client_->SearchString(
« no previous file with comments | « no previous file | pdf/pdfium/pdfium_page.cc » ('j') | pdf/pdfium/pdfium_page.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698