From eb6527763171cdb4b0fbfea5a20d691f4d67b660 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 19 May 2015 14:48:00 -0700 Subject: Remove FX_Alloc() null checks now that it can't return NULL. This permits some functions to become void's since they, in turn, can't fail. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1142713005 --- core/src/fxcodec/codec/fx_codec_fax.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'core/src/fxcodec/codec/fx_codec_fax.cpp') diff --git a/core/src/fxcodec/codec/fx_codec_fax.cpp b/core/src/fxcodec/codec/fx_codec_fax.cpp index 33e89e4f92..dc2ee2aacd 100644 --- a/core/src/fxcodec/codec/fx_codec_fax.cpp +++ b/core/src/fxcodec/codec/fx_codec_fax.cpp @@ -622,13 +622,7 @@ FX_BOOL CCodec_FaxDecoder::Create(FX_LPCBYTE src_buf, FX_DWORD src_size, int wid m_OutputWidth = m_OrigWidth; m_OutputHeight = m_OrigHeight; m_pScanlineBuf = FX_Alloc(FX_BYTE, m_Pitch); - if (m_pScanlineBuf == NULL) { - return FALSE; - } m_pRefBuf = FX_Alloc(FX_BYTE, m_Pitch); - if (m_pRefBuf == NULL) { - return FALSE; - } m_pSrcBuf = src_buf; m_SrcSize = src_size; m_nComps = 1; @@ -705,9 +699,6 @@ extern "C" { pitch = (width + 7) / 8; } FX_LPBYTE ref_buf = FX_Alloc(FX_BYTE, pitch); - if (ref_buf == NULL) { - return; - } FXSYS_memset8(ref_buf, 0xff, pitch); int bitpos = *pbitpos; for (int iRow = 0; iRow < height; iRow ++) { @@ -945,9 +936,6 @@ CCodec_FaxEncoder::CCodec_FaxEncoder(FX_LPCBYTE src_buf, int width, int height, m_Rows = height; m_Pitch = pitch; m_pRefLine = FX_Alloc(FX_BYTE, m_Pitch); - if (m_pRefLine == NULL) { - return; - } FXSYS_memset8(m_pRefLine, 0xff, m_Pitch); m_pLineBuf = FX_Alloc2D(FX_BYTE, m_Pitch, 8); m_DestBuf.EstimateSize(0, 10240); -- cgit v1.2.3