summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-06-19 11:19:19 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-06-19 11:25:19 +0200
commitd3e0ab976a5bbf63d1673422035def67ba9f4838 (patch)
treea001d03f8fdb0d24c95491cd1a7081205d5f669a /vcl
parentc3fae6be6067572aaf9f0c72ad35b69019a79135 (diff)
Avoid -fsanitize=shift-base about left-shift of negative values
...assuming these values are indeed intended to be negative (and <https: //developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6.html#Types>) mentions a "Fixed: 16.16-bit sgined fixed-point number" type, apparently represented here by F16Dot16, so the assumption looks plausible). During CppunitTest_vcl_pdfexport, encountered negative values -1184 and -22 with instdir/share/fonts/truetype/Carlito-Regular.ttf and -8 with instdir/share/fonts/truetype/LiberationSans-Bold.ttf. Change-Id: Ia07c61aebc2c9c67d0ed6173ecac94bab2abb2a8
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/fontsubset/sft.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 20620ea19f1f..b925846dac14 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -620,9 +620,9 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
cp.flags = nextComponent[i].flags;
const sal_uInt16 x = nextComponent[i].x;
const sal_uInt16 y = nextComponent[i].y;
- t = fixedMulDiv(a, x << 16, m) + fixedMulDiv(c, y << 16, m) + (e << 16);
+ t = fixedMulDiv(a, x << 16, m) + fixedMulDiv(c, y << 16, m) + sal_Int32(sal_uInt16(e) << 16);
cp.x = (sal_Int16)(fixedMul(t, m) >> 16);
- t = fixedMulDiv(b, x << 16, n) + fixedMulDiv(d, y << 16, n) + (f << 16);
+ t = fixedMulDiv(b, x << 16, n) + fixedMulDiv(d, y << 16, n) + sal_Int32(sal_uInt16(f) << 16);
cp.y = (sal_Int16)(fixedMul(t, n) >> 16);
myPoints.push_back( cp );