diff options
author | Lei Zhang <thestig@chromium.org> | 2015-12-14 18:34:00 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-12-14 18:34:00 -0800 |
commit | 412e908082a361d0fd9591eab939e96a882212f1 (patch) | |
tree | 11726052ae08f13dc5a05a82cbce870758580aeb /core/src/fxcodec/codec/fx_codec_jpeg.cpp | |
parent | 96660d6f382204339d6b1aadc3913303d436e252 (diff) | |
download | pdfium-412e908082a361d0fd9591eab939e96a882212f1.tar.xz |
Merge to XFA: Get rid of most instance of 'foo == NULL'
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1520063002 .
(cherry picked from commit e385244f8cd6ae376f6b3cf1265a0795d5d30eff)
Review URL: https://codereview.chromium.org/1528763003 .
Diffstat (limited to 'core/src/fxcodec/codec/fx_codec_jpeg.cpp')
-rw-r--r-- | core/src/fxcodec/codec/fx_codec_jpeg.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/src/fxcodec/codec/fx_codec_jpeg.cpp b/core/src/fxcodec/codec/fx_codec_jpeg.cpp index 0bb9e8aa26..4f0494691c 100644 --- a/core/src/fxcodec/codec/fx_codec_jpeg.cpp +++ b/core/src/fxcodec/codec/fx_codec_jpeg.cpp @@ -82,7 +82,7 @@ static void _error_do_nothing2(j_common_ptr cinfo, char*) {} static FX_BOOL _JpegEmbedIccProfile(j_compress_ptr cinfo, const uint8_t* icc_buf_ptr, FX_DWORD icc_length) { - if (icc_buf_ptr == NULL || icc_length == 0) { + if (!icc_buf_ptr || icc_length == 0) { return FALSE; } FX_DWORD icc_segment_size = (JPEG_MARKER_MAXSIZE - 2 - JPEG_OVERHEAD_LEN); @@ -516,7 +516,7 @@ ICodec_ScanlineDecoder* CCodec_JpegModule::CreateDecoder( int height, int nComps, FX_BOOL ColorTransform) { - if (src_buf == NULL || src_size == 0) { + if (!src_buf || src_size == 0) { return NULL; } CCodec_JpegDecoder* pDecoder = new CCodec_JpegDecoder; @@ -546,10 +546,9 @@ FX_BOOL CCodec_JpegModule::Encode(const CFX_DIBSource* pSource, int quality, const uint8_t* icc_buf, FX_DWORD icc_length) { - if (pSource->GetBPP() < 8 || pSource->GetPalette()) { - ASSERT(pSource->GetBPP() >= 8 && pSource->GetPalette() == NULL); + if (pSource->GetBPP() < 8 || pSource->GetPalette()) return FALSE; - } + _JpegEncode(pSource, dest_buf, dest_size, quality, icc_buf, icc_length); return TRUE; } |