Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3193)

Unified Diff: core/fxcodec/codec/fx_codec_tiff.cpp

Issue 2032613003: Get rid of NULLs in core/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Git rid of comparisons against NULL Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/fxcodec/codec/fx_codec_tiff.cpp
diff --git a/core/fxcodec/codec/fx_codec_tiff.cpp b/core/fxcodec/codec/fx_codec_tiff.cpp
index d4dc13926559c9a283a7a6f169db76929de25382..66ba7b46b7c25f461d215c611f90be4e9982a717 100644
--- a/core/fxcodec/codec/fx_codec_tiff.cpp
+++ b/core/fxcodec/codec/fx_codec_tiff.cpp
@@ -193,9 +193,9 @@ int TIFFCmyk2Rgb(thandle_t context,
uint8* r,
uint8* g,
uint8* b) {
- if (context == NULL) {
+ if (!context)
return 0;
- }
+
CCodec_TiffContext* p = (CCodec_TiffContext*)context;
if (p->icc_ctx) {
unsigned char cmyk[4], bgr[3];
@@ -209,11 +209,7 @@ int TIFFCmyk2Rgb(thandle_t context,
}
FX_BOOL CCodec_TiffContext::InitDecoder(IFX_FileRead* file_ptr) {
io.in = file_ptr;
- tif_ctx = _tiff_open(this, "r");
- if (tif_ctx == NULL) {
- return FALSE;
- }
- return TRUE;
+ return !!_tiff_open(this, "r");
}
void CCodec_TiffContext::GetFrames(int32_t& frames) {
frames = frame_num = TIFFNumberOfDirectories(tif_ctx);
@@ -399,7 +395,7 @@ FX_BOOL CCodec_TiffContext::Decode1bppRGB(CFX_DIBitmap* pDIBitmap,
SetPalette(pDIBitmap, bps);
int32_t size = (int32_t)TIFFScanlineSize(tif_ctx);
uint8_t* buf = (uint8_t*)_TIFFmalloc(size);
- if (buf == NULL) {
+ if (!buf) {
TIFFError(TIFFFileName(tif_ctx), "No space for scanline buffer");
return FALSE;
}
@@ -426,7 +422,7 @@ FX_BOOL CCodec_TiffContext::Decode8bppRGB(CFX_DIBitmap* pDIBitmap,
SetPalette(pDIBitmap, bps);
int32_t size = (int32_t)TIFFScanlineSize(tif_ctx);
uint8_t* buf = (uint8_t*)_TIFFmalloc(size);
- if (buf == NULL) {
+ if (!buf) {
TIFFError(TIFFFileName(tif_ctx), "No space for scanline buffer");
return FALSE;
}
@@ -459,7 +455,7 @@ FX_BOOL CCodec_TiffContext::Decode24bppRGB(CFX_DIBitmap* pDIBitmap,
}
int32_t size = (int32_t)TIFFScanlineSize(tif_ctx);
uint8_t* buf = (uint8_t*)_TIFFmalloc(size);
- if (buf == NULL) {
+ if (!buf) {
TIFFError(TIFFFileName(tif_ctx), "No space for scanline buffer");
return FALSE;
}

Powered by Google App Engine
This is Rietveld 408576698