summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2024-10-07 15:29:38 -0400
committerXisco Fauli <xiscofauli@libreoffice.org>2024-10-08 15:18:39 +0200
commit8400b5bf0d116b8ed193696820beeb812e89a9ac (patch)
tree4881be26e97fe694b93f69f7fbb9b8d522148e7a /vcl
parentffb4747aa6ee82791ce8a8ee35efaacd811f64d2 (diff)
avoid PDF export crash when ReadWithPossibleFixup falls back to Pdfium
Unfortunately, I failed to create a clean-room example, even when I pasted some binary garbage at the end of the file. Somehow I was getting a sanitized version from getAsStream. In any case, this prevents crashing with the two examples I have, although there are still significant problems somewhere because the export just results in empty pages... The problem is that reading again with the Pdfium-fixed version gets mixed in with the original read results, and things get pretty garbled. Probably m_rElements and everything needs to be cleared before tokenizing the fixup-version. Change-Id: I01daefa23b8f92e2849d71bca269ba2b476199da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174648 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 636e703722c1a36b4078de932b5a44855145c18a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174663 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/ipdf/pdfdocument.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx
index dac68d5344af..b5fbc757da57 100644
--- a/vcl/source/filter/ipdf/pdfdocument.cxx
+++ b/vcl/source/filter/ipdf/pdfdocument.cxx
@@ -1427,6 +1427,7 @@ bool PDFDocument::Read(SvStream& rStream)
nStartXRef = pPrev->GetValue();
// Reset state, except the edit buffer.
+ m_aOffsetTrailers.clear(); // contents are lifecycle managed by m_aElements
m_aElements.clear();
m_aOffsetObjects.clear();
m_aIDObjects.clear();