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

Side by Side Diff: core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp

Issue 896023003: Prevent base::CheckedNumeric from leaking outside of pdfium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Add name of new .h to build files. Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « core/src/fdrm/crypto/fx_crypt.cpp ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include <limits.h>
8
7 #include "../../../include/fpdfapi/fpdf_page.h" 9 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 10 #include "../../../include/fpdfapi/fpdf_module.h"
11 #include "../../../src/fxcrt/fx_safe_types.h"
9 #include "../../../third_party/numerics/safe_conversions_impl.h" 12 #include "../../../third_party/numerics/safe_conversions_impl.h"
10 #include "pageint.h" 13 #include "pageint.h"
11 #include <limits.h> 14
12 class CPDF_PSEngine; 15 class CPDF_PSEngine;
13 typedef enum {PSOP_ADD, PSOP_SUB, PSOP_MUL, PSOP_DIV, PSOP_IDIV, PSOP_MOD, 16 typedef enum {PSOP_ADD, PSOP_SUB, PSOP_MUL, PSOP_DIV, PSOP_IDIV, PSOP_MOD,
14 PSOP_NEG, PSOP_ABS, PSOP_CEILING, PSOP_FLOOR, PSOP_ROUND, PSOP_TRU NCATE, 17 PSOP_NEG, PSOP_ABS, PSOP_CEILING, PSOP_FLOOR, PSOP_ROUND, PSOP_TRU NCATE,
15 PSOP_SQRT, PSOP_SIN, PSOP_COS, PSOP_ATAN, PSOP_EXP, PSOP_LN, PSOP_ LOG, 18 PSOP_SQRT, PSOP_SIN, PSOP_COS, PSOP_ATAN, PSOP_EXP, PSOP_LN, PSOP_ LOG,
16 PSOP_CVI, PSOP_CVR, PSOP_EQ, PSOP_NE, PSOP_GT, PSOP_GE, PSOP_LT, P SOP_LE, 19 PSOP_CVI, PSOP_CVR, PSOP_EQ, PSOP_NE, PSOP_GT, PSOP_GE, PSOP_LT, P SOP_LE,
17 PSOP_AND, PSOP_OR, PSOP_XOR, PSOP_NOT, PSOP_BITSHIFT, PSOP_TRUE, P SOP_FALSE, 20 PSOP_AND, PSOP_OR, PSOP_XOR, PSOP_NOT, PSOP_BITSHIFT, PSOP_TRUE, P SOP_FALSE,
18 PSOP_IF, PSOP_IFELSE, PSOP_POP, PSOP_EXCH, PSOP_DUP, PSOP_COPY, 21 PSOP_IF, PSOP_IFELSE, PSOP_POP, PSOP_EXCH, PSOP_DUP, PSOP_COPY,
19 PSOP_INDEX, PSOP_ROLL, PSOP_PROC, PSOP_CONST 22 PSOP_INDEX, PSOP_ROLL, PSOP_PROC, PSOP_CONST
20 } PDF_PSOP; 23 } PDF_PSOP;
21 class CPDF_PSProc : public CFX_Object 24 class CPDF_PSProc : public CFX_Object
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 for (int i = 0; i < m_nOutputs; i ++) { 898 for (int i = 0; i < m_nOutputs; i ++) {
896 if (results[i] < m_pRanges[i * 2]) { 899 if (results[i] < m_pRanges[i * 2]) {
897 results[i] = m_pRanges[i * 2]; 900 results[i] = m_pRanges[i * 2];
898 } else if (results[i] > m_pRanges[i * 2 + 1]) { 901 } else if (results[i] > m_pRanges[i * 2 + 1]) {
899 results[i] = m_pRanges[i * 2 + 1]; 902 results[i] = m_pRanges[i * 2 + 1];
900 } 903 }
901 } 904 }
902 } 905 }
903 return TRUE; 906 return TRUE;
904 } 907 }
OLDNEW
« no previous file with comments | « core/src/fdrm/crypto/fx_crypt.cpp ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698