diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-05-19 15:19:32 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-05-19 15:19:32 -0700 |
commit | 981a3468319eb24e696bb64ba84d9631fd26f1f7 (patch) | |
tree | c1136b807975ccc80199ff6593e69475261c1670 /core/src/fxge/dib/fx_dib_main.cpp | |
parent | bf4aa2cc93a67826247e887b2ba26a1b965eb616 (diff) | |
download | pdfium-981a3468319eb24e696bb64ba84d9631fd26f1f7.tar.xz |
Re-land: Remove FX_Alloc() null checks now that it can't return NULL.
Fixes the ordering of some assignments broken when converting to checked
numerics in CFX_PathData::AddPointCount().
Original Review URL: https://codereview.chromium.org/1142713005
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1135893008
Diffstat (limited to 'core/src/fxge/dib/fx_dib_main.cpp')
-rw-r--r-- | core/src/fxge/dib/fx_dib_main.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp index a54c9abed0..f55b2f5737 100644 --- a/core/src/fxge/dib/fx_dib_main.cpp +++ b/core/src/fxge/dib/fx_dib_main.cpp @@ -85,12 +85,12 @@ FX_BOOL CFX_DIBitmap::Create(int width, int height, FXDIB_Format format, FX_LPBY int oomlimit = _MAX_OOM_LIMIT_; if (oomlimit >= 0 && size >= oomlimit) { m_pBuffer = FX_TryAlloc(FX_BYTE, size); + if (m_pBuffer == NULL) { + return FALSE; + } } else { m_pBuffer = FX_Alloc(FX_BYTE, size); } - if (m_pBuffer == NULL) { - return FALSE; - } } m_Width = width; m_Height = height; @@ -202,9 +202,6 @@ void CFX_DIBSource::BuildPalette() } if (GetBPP() == 1) { m_pPalette = FX_Alloc(FX_DWORD, 2); - if (!m_pPalette) { - return; - } if(IsCmykImage()) { m_pPalette[0] = 0xff; m_pPalette[1] = 0; @@ -214,9 +211,6 @@ void CFX_DIBSource::BuildPalette() } } else if (GetBPP() == 8) { m_pPalette = FX_Alloc(FX_DWORD, 256); - if (!m_pPalette) { - return; - } if(IsCmykImage()) { for (int i = 0; i < 256; i ++) { m_pPalette[i] = 0xff - i; @@ -531,9 +525,6 @@ void CFX_DIBSource::CopyPalette(const FX_DWORD* pSrc, FX_DWORD size) if (m_pPalette == NULL) { m_pPalette = FX_Alloc(FX_DWORD, pal_size); } - if (!m_pPalette) { - return; - } if (pal_size > size) { pal_size = size; } |