Index: core/src/fxge/dib/fx_dib_main.cpp |
diff --git a/core/src/fxge/dib/fx_dib_main.cpp b/core/src/fxge/dib/fx_dib_main.cpp |
index a54c9abed045d19c0492d3789e2ee1443270d84b..f55b2f573741a2eceadd9b3edbc28f8f7759f0ee 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; |
} |