office-gobmx/external/pdfium/ubsan.patch
Miklos Vajna 5352dfbbe2 pdfium: update to 3235
Change-Id: I2603b885567b409d81f1abfacd25c2a6d344311c
Reviewed-on: https://gerrit.libreoffice.org/43331
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2017-10-12 08:19:04 +02:00

42 lines
1.8 KiB
Diff

--- core/fxcodec/lbmp/fx_bmp.h
+++ core/fxcodec/lbmp/fx_bmp.h
@@ -126,7 +126,7 @@ class BMPDecompressor {
class CBmpContext : public CCodec_BmpModule::Context {
public:
CBmpContext(CCodec_BmpModule* pModule, CCodec_BmpModule::Delegate* pDelegate);
- ~CBmpContext() override;
+ ~CBmpContext() override {}
BMPDecompressor m_Bmp;
UnownedPtr<CCodec_BmpModule> const m_pModule;
--- core/fxge/cfx_facecache.cpp
+++ core/fxge/cfx_facecache.cpp
@@ -223,7 +223,8 @@ std::unique_ptr<CFX_GlyphBitmap> CFX_FaceCache::RenderGlyph(
}
}
} else {
- memset(pDestBuf, 0, dest_pitch * bmheight);
+ if (dest_pitch != 0 && bmheight != 0)
+ memset(pDestBuf, 0, dest_pitch * bmheight);
if (anti_alias == FXFT_RENDER_MODE_MONO &&
FXFT_Get_Bitmap_PixelMode(FXFT_Get_Glyph_Bitmap(m_Face)) ==
FXFT_PIXEL_MODE_MONO) {
--- third_party/agg23/agg_rasterizer_scanline_aa.h
+++ third_party/agg23/agg_rasterizer_scanline_aa.h
@@ -349,14 +349,14 @@ public:
cover += cur_cell->cover;
}
if(area) {
- alpha = calculate_alpha((cover << (poly_base_shift + 1)) - area, no_smooth);
+ alpha = calculate_alpha(int(unsigned(cover) << (poly_base_shift + 1)) - area, no_smooth);
if(alpha) {
sl.add_cell(x, alpha);
}
x++;
}
if(num_cells && cur_cell->x > x) {
- alpha = calculate_alpha(cover << (poly_base_shift + 1), no_smooth);
+ alpha = calculate_alpha(unsigned(cover) << (poly_base_shift + 1), no_smooth);
if(alpha) {
sl.add_span(x, cur_cell->x - x, alpha);
}