summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/render')
-rw-r--r--core/fpdfapi/render/fpdf_render_loadimage.cpp2
-rw-r--r--core/fpdfapi/render/fpdf_render_pattern.cpp20
2 files changed, 13 insertions, 9 deletions
diff --git a/core/fpdfapi/render/fpdf_render_loadimage.cpp b/core/fpdfapi/render/fpdf_render_loadimage.cpp
index a4f0e7befb..553481db60 100644
--- a/core/fpdfapi/render/fpdf_render_loadimage.cpp
+++ b/core/fpdfapi/render/fpdf_render_loadimage.cpp
@@ -551,7 +551,7 @@ int CPDF_DIBSource::CreateDecoder() {
} else if (decoder == "DCTDecode") {
m_pDecoder.reset(CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
src_data, src_size, m_Width, m_Height, m_nComponents,
- pParams ? pParams->GetIntegerFor("ColorTransform", 1) : 1));
+ !pParams || pParams->GetIntegerFor("ColorTransform", 1)));
if (!m_pDecoder) {
bool bTransform = false;
int comps;
diff --git a/core/fpdfapi/render/fpdf_render_pattern.cpp b/core/fpdfapi/render/fpdf_render_pattern.cpp
index dfb5669d8f..f55a0e8b97 100644
--- a/core/fpdfapi/render/fpdf_render_pattern.cpp
+++ b/core/fpdfapi/render/fpdf_render_pattern.cpp
@@ -54,17 +54,19 @@ void DrawAxialShading(CFX_DIBitmap* pBitmap,
FX_FLOAT start_y = pCoords->GetNumberAt(1);
FX_FLOAT end_x = pCoords->GetNumberAt(2);
FX_FLOAT end_y = pCoords->GetNumberAt(3);
- FX_FLOAT t_min = 0, t_max = 1.0f;
+ FX_FLOAT t_min = 0;
+ FX_FLOAT t_max = 1.0f;
CPDF_Array* pArray = pDict->GetArrayFor("Domain");
if (pArray) {
t_min = pArray->GetNumberAt(0);
t_max = pArray->GetNumberAt(1);
}
- FX_BOOL bStartExtend = FALSE, bEndExtend = FALSE;
+ FX_BOOL bStartExtend = FALSE;
+ FX_BOOL bEndExtend = FALSE;
pArray = pDict->GetArrayFor("Extend");
if (pArray) {
- bStartExtend = pArray->GetIntegerAt(0);
- bEndExtend = pArray->GetIntegerAt(1);
+ bStartExtend = !!pArray->GetIntegerAt(0);
+ bEndExtend = !!pArray->GetIntegerAt(1);
}
int width = pBitmap->GetWidth();
int height = pBitmap->GetHeight();
@@ -139,17 +141,19 @@ void DrawRadialShading(CFX_DIBitmap* pBitmap,
FX_FLOAT end_r = pCoords->GetNumberAt(5);
CFX_Matrix matrix;
matrix.SetReverse(*pObject2Bitmap);
- FX_FLOAT t_min = 0, t_max = 1.0f;
+ FX_FLOAT t_min = 0;
+ FX_FLOAT t_max = 1.0f;
CPDF_Array* pArray = pDict->GetArrayFor("Domain");
if (pArray) {
t_min = pArray->GetNumberAt(0);
t_max = pArray->GetNumberAt(1);
}
- FX_BOOL bStartExtend = FALSE, bEndExtend = FALSE;
+ FX_BOOL bStartExtend = FALSE;
+ FX_BOOL bEndExtend = FALSE;
pArray = pDict->GetArrayFor("Extend");
if (pArray) {
- bStartExtend = pArray->GetIntegerAt(0);
- bEndExtend = pArray->GetIntegerAt(1);
+ bStartExtend = !!pArray->GetIntegerAt(0);
+ bEndExtend = !!pArray->GetIntegerAt(1);
}
uint32_t total_results =
std::max(CountOutputs(funcs), pCS->CountComponents());