Index: pdf/pdfium/pdfium_page.cc |
diff --git a/pdf/pdfium/pdfium_page.cc b/pdf/pdfium/pdfium_page.cc |
index cd75a1bc3716982bdbcb06ff3707d8f80183ba8a..adf9cac484bfd1334da8f69c38e491fa6760517c 100644 |
--- a/pdf/pdfium/pdfium_page.cc |
+++ b/pdf/pdfium/pdfium_page.cc |
@@ -324,7 +324,7 @@ PDFiumPage::Area PDFiumPage::GetLinkTarget( |
size_t buffer_size = |
FPDFAction_GetURIPath(engine_->doc(), action, NULL, 0); |
if (buffer_size > 1) { |
- void* data = WriteInto(&target->url, buffer_size + 1); |
+ void* data = WriteInto(&target->url, buffer_size); |
FPDFAction_GetURIPath(engine_->doc(), action, data, buffer_size); |
} |
} |
@@ -406,7 +406,7 @@ void PDFiumPage::CalculateLinks() { |
for (int i = 0; i < count; ++i) { |
base::string16 url; |
int url_length = FPDFLink_GetURL(links, i, NULL, 0); |
- if (url_length > 1) { // WriteInto needs at least 2 characters. |
+ if (url_length > 0) { |
unsigned short* data = |
reinterpret_cast<unsigned short*>(WriteInto(&url, url_length + 1)); |
raymes
2015/01/14 00:13:12
I just had another look at this and I think that w
Lei Zhang
2015/01/14 01:21:54
Gah! I will make another CL...
Deepak
2015/01/14 03:50:38
I personally don't think that FPDFLink_GetURL() gi
|
FPDFLink_GetURL(links, i, data, url_length); |