summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhong_zhang <hong_zhang@foxitsoftware.com>2016-09-12 09:54:38 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-12 09:54:38 -0700
commit25a7f3e58b6a7f3396e529f38e81f93fb87c4045 (patch)
treee429be0a5eeaecb11ac0f37e95741b6e5ed42171
parent1c62054a42cf0759148501a36c541de5d5769d32 (diff)
downloadpdfium-25a7f3e58b6a7f3396e529f38e81f93fb87c4045.tar.xz
fix some uninitialized variables
BUG=627399 Review-Url: https://codereview.chromium.org/2328003002
-rw-r--r--core/fxcodec/codec/fx_codec_tiff.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/fxcodec/codec/fx_codec_tiff.cpp b/core/fxcodec/codec/fx_codec_tiff.cpp
index 20fda6308f..2a00bb2d20 100644
--- a/core/fxcodec/codec/fx_codec_tiff.cpp
+++ b/core/fxcodec/codec/fx_codec_tiff.cpp
@@ -257,7 +257,7 @@ bool CCodec_TiffContext::IsSupport(const CFX_DIBitmap* pDIBitmap) const {
if (TIFFIsTiled(m_tif_ctx))
return false;
- uint16_t photometric;
+ uint16_t photometric = 0;
if (!TIFFGetField(m_tif_ctx, TIFFTAG_PHOTOMETRIC, &photometric))
return false;
@@ -276,7 +276,7 @@ bool CCodec_TiffContext::IsSupport(const CFX_DIBitmap* pDIBitmap) const {
default:
return false;
}
- uint16_t planarconfig;
+ uint16_t planarconfig = 0;
if (!TIFFGetFieldDefaulted(m_tif_ctx, TIFFTAG_PLANARCONFIG, &planarconfig))
return false;
@@ -284,9 +284,9 @@ bool CCodec_TiffContext::IsSupport(const CFX_DIBitmap* pDIBitmap) const {
}
void CCodec_TiffContext::SetPalette(CFX_DIBitmap* pDIBitmap, uint16_t bps) {
- uint16_t* red_orig;
- uint16_t* green_orig;
- uint16_t* blue_orig;
+ uint16_t* red_orig = nullptr;
+ uint16_t* green_orig = nullptr;
+ uint16_t* blue_orig = nullptr;
TIFFGetField(m_tif_ctx, TIFFTAG_COLORMAP, &red_orig, &green_orig, &blue_orig);
for (int32_t i = (1L << bps) - 1; i >= 0; i--) {
#define CVT(x) ((uint16_t)((x) >> 8))
@@ -421,8 +421,8 @@ bool CCodec_TiffContext::Decode(CFX_DIBitmap* pDIBitmap) {
return true;
}
}
- uint16_t spp;
- uint16_t bps;
+ uint16_t spp = 0;
+ uint16_t bps = 0;
TIFFGetField(m_tif_ctx, TIFFTAG_SAMPLESPERPIXEL, &spp);
TIFFGetField(m_tif_ctx, TIFFTAG_BITSPERSAMPLE, &bps);
uint32_t bpp = bps * spp;