Index: core/fxcodec/codec/fx_codec_jpeg.cpp |
diff --git a/core/fxcodec/codec/fx_codec_jpeg.cpp b/core/fxcodec/codec/fx_codec_jpeg.cpp |
index c41dde943f040e9ad866dfa4950e70b9845c00f3..4f4bdb196c47b32b7b2154614d106aaa6c7efb58 100644 |
--- a/core/fxcodec/codec/fx_codec_jpeg.cpp |
+++ b/core/fxcodec/codec/fx_codec_jpeg.cpp |
@@ -182,7 +182,7 @@ static void _JpegEncode(const CFX_DIBSource* pSource, |
} else { |
cinfo.in_color_space = JCS_CMYK; |
} |
- uint8_t* line_buf = NULL; |
+ uint8_t* line_buf = nullptr; |
if (nComponents > 1) { |
line_buf = FX_Alloc2D(uint8_t, width, nComponents); |
} |
@@ -234,9 +234,6 @@ static void _JpegEncode(const CFX_DIBSource* pSource, |
#ifdef PDF_ENABLE_XFA |
static void _JpegLoadAttribute(struct jpeg_decompress_struct* pInfo, |
CFX_DIBAttribute* pAttribute) { |
- if (pInfo == NULL || pAttribute == NULL) { |
- return; |
- } |
if (pAttribute) { |
pAttribute->m_nXDPI = pInfo->X_density; |
pAttribute->m_nYDPI = pInfo->Y_density; |
@@ -298,7 +295,7 @@ static FX_BOOL _JpegLoadInfo(const uint8_t* src_buf, |
cinfo.jpeg_color_space == JCS_YCbCr || cinfo.jpeg_color_space == JCS_YCCK; |
bits_per_components = cinfo.data_precision; |
if (icc_buf_ptr) { |
- *icc_buf_ptr = NULL; |
+ *icc_buf_ptr = nullptr; |
} |
if (icc_length) { |
*icc_length = 0; |
@@ -343,7 +340,7 @@ class CCodec_JpegDecoder : public CCodec_ScanlineDecoder { |
}; |
CCodec_JpegDecoder::CCodec_JpegDecoder() { |
- m_pScanlineBuf = NULL; |
+ m_pScanlineBuf = nullptr; |
m_bStarted = FALSE; |
m_bInited = FALSE; |
FXSYS_memset(&cinfo, 0, sizeof(cinfo)); |
@@ -483,13 +480,13 @@ CCodec_ScanlineDecoder* CCodec_JpegModule::CreateDecoder( |
int nComps, |
FX_BOOL ColorTransform) { |
if (!src_buf || src_size == 0) { |
- return NULL; |
+ return nullptr; |
} |
CCodec_JpegDecoder* pDecoder = new CCodec_JpegDecoder; |
if (!pDecoder->Create(src_buf, src_size, width, height, nComps, |
ColorTransform)) { |
delete pDecoder; |
- return NULL; |
+ return nullptr; |
} |
return pDecoder; |
} |
@@ -647,7 +644,7 @@ FX_BOOL CCodec_JpegModule::ReadScanline(FXJPEG_Context* ctx, |
uint32_t CCodec_JpegModule::GetAvailInput(FXJPEG_Context* ctx, |
uint8_t** avail_buf_ptr) { |
if (avail_buf_ptr) { |
- *avail_buf_ptr = NULL; |
+ *avail_buf_ptr = nullptr; |
if (ctx->m_SrcMgr.bytes_in_buffer > 0) { |
*avail_buf_ptr = (uint8_t*)ctx->m_SrcMgr.next_input_byte; |
} |