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

Unified Diff: fpdfsdk/fpdf_dataavail.cpp

Issue 2294383003: Use unsigned page indexes in CPDF_HintTables. (Closed)
Patch Set: more safe math Created 4 years, 3 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/fpdfapi/fpdf_parser/include/cpdf_data_avail.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdf_dataavail.cpp
diff --git a/fpdfsdk/fpdf_dataavail.cpp b/fpdfsdk/fpdf_dataavail.cpp
index 7b9ba32fb0cc2ea5f64e06ad6943b73241473239..1a83fdf64b0f7d0ef99feb55108f16338c9f6380 100644
--- a/fpdfsdk/fpdf_dataavail.cpp
+++ b/fpdfsdk/fpdf_dataavail.cpp
@@ -162,6 +162,8 @@ DLLEXPORT int STDCALL FPDFAvail_IsPageAvail(FPDF_AVAIL avail,
FX_DOWNLOADHINTS* hints) {
if (!avail || !hints)
return PDF_DATA_ERROR;
+ if (page_index < 0)
+ return PDF_DATA_NOTAVAIL;
CFPDF_DownloadHintsWrap hints_wrap(hints);
return CFPDFDataAvailFromFPDFAvail(avail)->m_pDataAvail->IsPageAvail(
page_index, &hints_wrap);
« no previous file with comments | « core/fpdfapi/fpdf_parser/include/cpdf_data_avail.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698