summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/codec/fx_codec_jbig.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-14 22:22:13 -0700
committerLei Zhang <thestig@chromium.org>2015-08-14 22:22:13 -0700
commitda180e9fdd4385df024cc18046f62ca47bc74d74 (patch)
tree931e0e64ac2cbc82e3718e43418ee6bd676da4a5 /core/src/fxcodec/codec/fx_codec_jbig.cpp
parent2b1a2d528469cda4e9f3e36d3c7a649e0d476480 (diff)
downloadpdfium-da180e9fdd4385df024cc18046f62ca47bc74d74.tar.xz
Merge to XFA: Don't bother checking pointers before delete[] and FX_Free().
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1297713003 . (cherry picked from commit cb62e7657b3a9a04142028a4e6614029a08e894b) Review URL: https://codereview.chromium.org/1287053005 .
Diffstat (limited to 'core/src/fxcodec/codec/fx_codec_jbig.cpp')
-rw-r--r--core/src/fxcodec/codec/fx_codec_jbig.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/core/src/fxcodec/codec/fx_codec_jbig.cpp b/core/src/fxcodec/codec/fx_codec_jbig.cpp
index 9d78bba3bb..1551060b60 100644
--- a/core/src/fxcodec/codec/fx_codec_jbig.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jbig.cpp
@@ -82,9 +82,7 @@ FX_BOOL CCodec_Jbig2Module::Decode(IFX_FileRead* file_ptr,
FX_Free(src_buf);
return TRUE;
failed:
- if (src_buf) {
- FX_Free(src_buf);
- }
+ FX_Free(src_buf);
return FALSE;
}
FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context,
@@ -188,9 +186,7 @@ FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context,
FX_Free(m_pJbig2Context->m_src_buf);
return FXCODEC_STATUS_DECODE_FINISH;
failed:
- if (m_pJbig2Context->m_src_buf) {
- FX_Free(m_pJbig2Context->m_src_buf);
- }
+ FX_Free(m_pJbig2Context->m_src_buf);
m_pJbig2Context->m_src_buf = NULL;
return FXCODEC_STATUS_ERROR;
}
@@ -206,9 +202,7 @@ FXCODEC_STATUS CCodec_Jbig2Module::ContinueDecode(void* pJbig2Context,
CJBig2_Context::DestroyContext(m_pJbig2Context->m_pContext);
m_pJbig2Context->m_pContext = NULL;
if (ret != JBIG2_SUCCESS) {
- if (m_pJbig2Context->m_src_buf) {
- FX_Free(m_pJbig2Context->m_src_buf);
- }
+ FX_Free(m_pJbig2Context->m_src_buf);
m_pJbig2Context->m_src_buf = NULL;
return FXCODEC_STATUS_ERROR;
}