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 d9e401897b3bfb9cf5d07c2bc18db29095c10f88..12812b2f8da14182841e1b030e5cde1e656afcc8 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; |
@@ -205,9 +205,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; |
@@ -217,9 +214,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; |
@@ -537,9 +531,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; |
} |