From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- external/pdfium/ubsan.patch | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 external/pdfium/ubsan.patch (limited to 'external/pdfium/ubsan.patch') diff --git a/external/pdfium/ubsan.patch b/external/pdfium/ubsan.patch new file mode 100644 index 000000000..bc9868244 --- /dev/null +++ b/external/pdfium/ubsan.patch @@ -0,0 +1,24 @@ +--- core/fxcrt/string_data_template.cpp ++++ core/fxcrt/string_data_template.cpp +@@ -82,7 +82,8 @@ void StringDataTemplate::CopyContentsAt(size_t offset, + DCHECK_GE(offset, 0); + DCHECK_GE(nLen, 0); + DCHECK_LE(offset + nLen, m_nAllocLength); +- memcpy(m_String + offset, pStr, nLen * sizeof(CharType)); ++ if (nLen != 0) ++ memcpy(m_String + offset, pStr, nLen * sizeof(CharType)); + m_String[offset + nLen] = 0; + } + +--- core/fxge/cfx_glyphcache.cpp ++++ core/fxge/cfx_glyphcache.cpp +@@ -183,7 +183,8 @@ std::unique_ptr CFX_GlyphCache::RenderGlyph( + } + } + } else { +- memset(pDestBuf, 0, dest_pitch * bmheight); ++ if (dest_pitch != 0 && bmheight != 0) ++ memset(pDestBuf, 0, dest_pitch * bmheight); + int rowbytes = std::min(abs(src_pitch), dest_pitch); + for (int row = 0; row < bmheight; row++) + memcpy(pDestBuf + row * dest_pitch, pSrcBuf + row * src_pitch, rowbytes); -- cgit v1.2.3