summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_function.cpp
AgeCommit message (Collapse)Author
2018-05-09Mark numerious pointers as const.Lei Zhang
They are mostly CPDF_Object* and derived classes, but others that should be are marked const as well. Change-Id: Ib3344d7d8db90940df8edc97c0dd6c59da080541 Reviewed-on: https://pdfium-review.googlesource.com/32180 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-04-19Validate the Range key in Functions.Lei Zhang
They are required for type 0 and type 4 functions. The number of outputs should not be 0. Change-Id: I4cb1fa14a32ef0a1c92230d83461c697f389106f Reviewed-on: https://pdfium-review.googlesource.com/30931 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-04-17Fix nits in CPDF_Function and derived classes.Lei Zhang
- 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 <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-04-16Fix some checks for FX_Realloc() failures.Lei Zhang
FX_Realloc() never fails. So either remove the check or switch to FX_TryRealloc(). Change-Id: I11fd02508add50db900a7502835018c2b61bcd09 Reviewed-on: https://pdfium-review.googlesource.com/30712 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-04-12Make the input data to CPDF_ColorSpace::GetRGB() const.Lei Zhang
Make a copy of the input data when clamping it in CPDF_Function::Call(). Change-Id: I1d2b3d080977f0f9a4c3ccaf111780867668991a Reviewed-on: https://pdfium-review.googlesource.com/30350 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-04-11Avoid stack overflow when loading CPDF_Function.chromium/3395Henrique Nakashima
CPDF_StitchFuncs that reference each other create a Load() loop. Maintaining a set of the visited CPDF_Objects during a Load() call tree prevents that. Bug: chromium:830221 Change-Id: I6f494da16c6d79f05870ff85cff38ff8fe69ecfe Reviewed-on: https://pdfium-review.googlesource.com/30050 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-05-25Break apart the pageint.h file.Dan Sinclair
This CL separates pageint.h and the supporting cpp files into indivudal class files. Change-Id: Idcadce41976a8cd5f0d916e6a5ebbc283fd36527 Reviewed-on: https://pdfium-review.googlesource.com/5930 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>