build fix
[LibreOffice.git] / external / graphite / ubsan.patch
blob2f3bf5e7baf604b86ab36fec07b6167e69f65bd7
1 --- src/gr_face.cpp
2 +++ src/gr_face.cpp
3 @@ -87,7 +87,7 @@
5 Face *res = new Face(appFaceHandle, *ops);
6 if (res && load_face(*res, faceOptions))
7 - return static_cast<gr_face *>(res);
8 + return reinterpret_cast<gr_face *>(res);
10 delete res;
11 return 0;
12 @@ -195,7 +195,7 @@
14 void gr_face_destroy(gr_face *face)
16 - delete face;
17 + delete static_cast<Face *>(face);
21 --- src/gr_font.cpp
22 +++ src/gr_font.cpp
23 @@ -50,7 +50,7 @@
24 if (face == 0) return 0;
26 Font * const res = new Font(ppm, *face, appFontHandle, font_ops);
27 - return static_cast<gr_font*>(res);
28 + return reinterpret_cast<gr_font*>(res);
31 gr_font* gr_make_font_with_advance_fn(float ppm/*pixels per em*/, const void* appFontHandle/*non-NULL*/, gr_advance_fn getAdvance, const gr_face * face/*needed for scaling*/)
32 @@ -61,7 +61,7 @@
34 void gr_font_destroy(gr_font *font)
36 - delete font;
37 + delete static_cast<Font *>(font);