From 8cfcb7da37352b22517892e6eabcedb77676cdf7 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 17 Apr 2018 16:16:39 +0000 Subject: Fix nits in CPDF_Function and derived classes. - Switch away from FX_Alloc2D() when it is safe to do so. - Use FX_SAFE_SIZE_T to avoid a potential underflow with FX_Realloc(). - Mark the v_Call() input as const. - Check Call() and v_Call() return results. Change-Id: I6ec3122b23e0f137f88aa8d85a9675154a1b1706 Reviewed-on: https://pdfium-review.googlesource.com/30802 Reviewed-by: Henrique Nakashima Commit-Queue: Lei Zhang --- core/fpdfapi/page/cpdf_psfunc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/fpdfapi/page/cpdf_psfunc.cpp') diff --git a/core/fpdfapi/page/cpdf_psfunc.cpp b/core/fpdfapi/page/cpdf_psfunc.cpp index 6df7dff20c..2230d4e241 100644 --- a/core/fpdfapi/page/cpdf_psfunc.cpp +++ b/core/fpdfapi/page/cpdf_psfunc.cpp @@ -19,7 +19,7 @@ bool CPDF_PSFunc::v_Init(CPDF_Object* pObj, std::set* pVisited) { return m_PS.Parse(pAcc->GetSpan()); } -bool CPDF_PSFunc::v_Call(float* inputs, float* results) const { +bool CPDF_PSFunc::v_Call(const float* inputs, float* results) const { CPDF_PSEngine& PS = const_cast(m_PS); PS.Reset(); for (uint32_t i = 0; i < m_nInputs; i++) -- cgit v1.2.3