| OLD | NEW |
| 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> | 7 #include <limits.h> |
| 8 |
| 8 #include "../../../include/fxcrt/fx_basic.h" | 9 #include "../../../include/fxcrt/fx_basic.h" |
| 9 #include "../../../include/fxcrt/fx_coordinates.h" | 10 #include "../../../include/fxcrt/fx_coordinates.h" |
| 10 #include "../../../src/fxcrt/fx_safe_types.h" | 11 #include "../../../include/fxcrt/fx_safe_types.h" |
| 11 #include "JBig2_Image.h" | 12 #include "JBig2_Image.h" |
| 12 | 13 |
| 13 CJBig2_Image::CJBig2_Image(FX_INT32 w, FX_INT32 h) | 14 CJBig2_Image::CJBig2_Image(FX_INT32 w, FX_INT32 h) |
| 14 { | 15 { |
| 15 m_nWidth = w; | 16 m_nWidth = w; |
| 16 m_nHeight = h; | 17 m_nHeight = h; |
| 17 if (m_nWidth <= 0 || m_nHeight <= 0 || m_nWidth > INT_MAX - 31) { | 18 if (m_nWidth <= 0 || m_nHeight <= 0 || m_nWidth > INT_MAX - 31) { |
| 18 m_pData = NULL; | 19 m_pData = NULL; |
| 19 m_bNeedFree = FALSE; | 20 m_bNeedFree = FALSE; |
| 20 return; | 21 return; |
| (...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1621 dp[2] = (FX_BYTE)(tmp >> 8); | 1622 dp[2] = (FX_BYTE)(tmp >> 8); |
| 1622 dp[3] = (FX_BYTE)tmp; | 1623 dp[3] = (FX_BYTE)tmp; |
| 1623 } | 1624 } |
| 1624 lineSrc += m_nStride; | 1625 lineSrc += m_nStride; |
| 1625 lineDst += pDst->m_nStride; | 1626 lineDst += pDst->m_nStride; |
| 1626 } | 1627 } |
| 1627 } | 1628 } |
| 1628 } | 1629 } |
| 1629 return 1; | 1630 return 1; |
| 1630 } | 1631 } |
| OLD | NEW |