summaryrefslogtreecommitdiff
path: root/core/fxcodec
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-04-16 20:26:28 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-16 20:26:28 +0000
commit33906880888288fa552137fb43bf21bdc19cb187 (patch)
tree5737dfce95baa94a061ee2965e67aef628f955ec /core/fxcodec
parent846fb0301a146319826a04c4a6e2fafadf92813a (diff)
downloadpdfium-33906880888288fa552137fb43bf21bdc19cb187.tar.xz
Fix some checks for FX_Realloc() failures.
FX_Realloc() never fails. So either remove the check or switch to FX_TryRealloc(). Change-Id: I11fd02508add50db900a7502835018c2b61bcd09 Reviewed-on: https://pdfium-review.googlesource.com/30712 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcodec')
-rw-r--r--core/fxcodec/codec/fx_codec_progress.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp
index 4588cd13f3..f2799dcb45 100644
--- a/core/fxcodec/codec/fx_codec_progress.cpp
+++ b/core/fxcodec/codec/fx_codec_progress.cpp
@@ -305,7 +305,7 @@ bool CCodec_ProgressiveDecoder::JpegReadMoreData(CCodec_JpegModule* pJpegModule,
}
m_SrcSize = (dwSize + dwAvail + FXCODEC_BLOCK_SIZE - 1) /
FXCODEC_BLOCK_SIZE * FXCODEC_BLOCK_SIZE;
- m_pSrcBuf = FX_Realloc(uint8_t, m_pSrcBuf, m_SrcSize);
+ m_pSrcBuf = FX_TryRealloc(uint8_t, m_pSrcBuf, m_SrcSize);
if (!m_pSrcBuf) {
err_status = FXCODEC_STATUS_ERR_MEMORY;
return false;
@@ -576,7 +576,7 @@ bool CCodec_ProgressiveDecoder::GifReadMoreData(CCodec_GifModule* pGifModule,
}
m_SrcSize = (dwSize + dwAvail + FXCODEC_BLOCK_SIZE - 1) /
FXCODEC_BLOCK_SIZE * FXCODEC_BLOCK_SIZE;
- m_pSrcBuf = FX_Realloc(uint8_t, m_pSrcBuf, m_SrcSize);
+ m_pSrcBuf = FX_TryRealloc(uint8_t, m_pSrcBuf, m_SrcSize);
if (!m_pSrcBuf) {
err_status = FXCODEC_STATUS_ERR_MEMORY;
return false;
@@ -863,7 +863,7 @@ bool CCodec_ProgressiveDecoder::BmpReadMoreData(CCodec_BmpModule* pBmpModule,
}
m_SrcSize = (dwSize + dwAvail + FXCODEC_BLOCK_SIZE - 1) /
FXCODEC_BLOCK_SIZE * FXCODEC_BLOCK_SIZE;
- m_pSrcBuf = FX_Realloc(uint8_t, m_pSrcBuf, m_SrcSize);
+ m_pSrcBuf = FX_TryRealloc(uint8_t, m_pSrcBuf, m_SrcSize);
if (!m_pSrcBuf) {
err_status = FXCODEC_STATUS_ERR_MEMORY;
return false;