From 981a3468319eb24e696bb64ba84d9631fd26f1f7 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 19 May 2015 15:19:32 -0700 Subject: 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 --- core/src/fxge/win32/fx_win32_dib.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'core/src/fxge/win32/fx_win32_dib.cpp') diff --git a/core/src/fxge/win32/fx_win32_dib.cpp b/core/src/fxge/win32/fx_win32_dib.cpp index ec523c39c1..46abdb366c 100644 --- a/core/src/fxge/win32/fx_win32_dib.cpp +++ b/core/src/fxge/win32/fx_win32_dib.cpp @@ -69,12 +69,6 @@ CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, LPVOID pData, FX_BOOL FXSYS_memcpy32(pBitmap->GetBuffer(), pData, pitch * height); if (bBottomUp) { FX_LPBYTE temp_buf = FX_Alloc(FX_BYTE, pitch); - if (!temp_buf) { - if (pBitmap) { - delete pBitmap; - } - return NULL; - } int top = 0, bottom = height - 1; while (top < bottom) { FXSYS_memcpy32(temp_buf, pBitmap->GetBuffer() + top * pitch, pitch); @@ -203,13 +197,6 @@ CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC, HBITMAP hBitmap, FX_DWORD* pP size += sizeof (FX_DWORD) * 254; } BITMAPINFO* pbmih = (BITMAPINFO*)FX_Alloc(FX_BYTE, size); - if (!pbmih) { - delete pDIBitmap; - if (bCreatedDC) { - DeleteDC(hDC); - } - return NULL; - } pbmih->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); pbmih->bmiHeader.biBitCount = bmih.biBitCount; pbmih->bmiHeader.biCompression = BI_RGB; -- cgit v1.2.3