summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/render')
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 9965cbb945..95d3cbe5de 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -50,6 +50,7 @@
#include "core/fpdfdoc/cpdf_occontext.h"
#include "core/fxcrt/autorestorer.h"
#include "core/fxcrt/fx_safe_types.h"
+#include "core/fxcrt/fx_system.h"
#include "core/fxcrt/maybe_owned.h"
#include "core/fxge/cfx_defaultrenderdevice.h"
#include "core/fxge/cfx_graphstatedata.h"
@@ -262,6 +263,9 @@ void DrawRadialShading(const RetainPtr<CFX_DIBitmap>& pBitmap,
float a = ((start_x - end_x) * (start_x - end_x)) +
((start_y - end_y) * (start_y - end_y)) -
((start_r - end_r) * (start_r - end_r));
+ if (IsFloatZero(a))
+ a = 0.0f;
+
int width = pBitmap->GetWidth();
int height = pBitmap->GetHeight();
int pitch = pBitmap->GetPitch();
@@ -285,7 +289,7 @@ void DrawRadialShading(const RetainPtr<CFX_DIBitmap>& pBitmap,
float c = ((pos.x - start_x) * (pos.x - start_x)) +
((pos.y - start_y) * (pos.y - start_y)) - (start_r * start_r);
float s;
- if (a == 0) {
+ if (a == 0.0f) {
s = -c / b;
} else {
float b2_4ac = (b * b) - 4 * (a * c);