Fix the potential integer overflow from 'offset+size' in extension.h and fpdfview.cpp
[pdfium.git] / core / include / fxcrt / fx_system.h
index a757de4..3913803 100644 (file)
@@ -276,7 +276,11 @@ int                        FXSYS_round(FX_FLOAT f);
 #ifdef __cplusplus
 };
 
-#if defined(__clang__) || defined(_MSC_VER)
+#include "../../../third_party/numerics/safe_math.h"
+typedef base::CheckedNumeric<FX_DWORD>                 FX_SAFE_DWORD;
+typedef base::CheckedNumeric<FX_INT32>                 FX_SAFE_INT;
+typedef base::CheckedNumeric<size_t>            FX_SAFE_SIZET;
+#if defined(__clang__) || _MSC_VER >= 1700
 #define FX_FINAL final
 #elif defined(__GNUC__) && __cplusplus >= 201103 && \
       (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700