summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2020-03-19 13:53:45 +0100
committerThomas Deutschmann <whissi@gentoo.org>2020-08-13 11:28:25 +0200
commitdc2ba49207af71193f1390d84bba4e15aeea0ce0 (patch)
tree79c2a51cb5fa2b87800b1113e0015a7108cd2eb3 /psi/zfont2.c
parentImport Ghostscript 9.50 (diff)
downloadghostscript-gpl-patches-dc2ba49207af71193f1390d84bba4e15aeea0ce0.tar.gz
ghostscript-gpl-patches-dc2ba49207af71193f1390d84bba4e15aeea0ce0.tar.bz2
ghostscript-gpl-patches-dc2ba49207af71193f1390d84bba4e15aeea0ce0.zip
Import Ghostscript 9.52ghostscript-9.52
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'psi/zfont2.c')
-rw-r--r--psi/zfont2.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/psi/zfont2.c b/psi/zfont2.c
index 19c1e9ef..6e424c9d 100644
--- a/psi/zfont2.c
+++ b/psi/zfont2.c
@@ -1667,8 +1667,14 @@ undelta(ref *ops, unsigned int cnt)
unsigned int i;
for (i = 0; i < cnt; i++) {
- if (!r_has_type(&ops[i], t_real))
- make_real(&ops[i], (float)ops[i].value.intval);
+ if (!r_has_type(&ops[i], t_real)) {
+ /* Strictly speaking assigning one element of union
+ * to another, overlapping element of a different size is
+ * undefined behavior, hence assign to an intermediate variable
+ */
+ float fl = (float)ops[i].value.intval;
+ make_real(&ops[i], fl);
+ }
}
for (i = 1; i < cnt; i++) {
make_real(&ops[i], ops[i].value.realval + ops[i - 1].value.realval);