summaryrefslogtreecommitdiff
path: root/base/gspaint.c
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2016-04-23 10:59:46 +0100
committerKen Sharp <ken.sharp@artifex.com>2016-04-23 11:00:22 +0100
commit88a145bebee34481862ea79d09098eb71dd15e38 (patch)
tree7fc40dfe80c256ae7e3f3c60bb97cf9848cba906 /base/gspaint.c
parent2f622fe34c6290e737216dbc85d93efcdd3895fd (diff)
downloadghostpdl-88a145bebee34481862ea79d09098eb71dd15e38.tar.gz
Coverity ID 94810 - properly bracket macro
gx_setcurrentpoint is a macro, with 2 lines of code. This meant the else clause was only applied to the first line, and the second was always processed. Fortuitously the if clause would have invalidated the current point so I believe this is always safe, but its best to be certain and not corrupt the current point.
Diffstat (limited to 'base/gspaint.c')
-rw-r--r--base/gspaint.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/base/gspaint.c b/base/gspaint.c
index 55cb6ae74..0aeaeab6e 100644
--- a/base/gspaint.c
+++ b/base/gspaint.c
@@ -524,8 +524,9 @@ gs_strokepath_aux(gs_state * pgs, bool traditional)
/* NB: needs testing with PCL */
if (gx_path_is_void(pgs->path))
pgs->current_point_valid = false;
- else
+ else {
gx_setcurrentpoint(pgs, fixed2float(spath.position.x), fixed2float(spath.position.y));
+ }
return 0;
}