summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Dawson <brucedawson@chromium.org>2017-12-06 22:32:41 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-06 22:32:41 +0000
commit7b0be4ced5f3687e922fc9ed11a4c49fe9848221 (patch)
treedff851f231bc032f4aa03593ebb8939bb4bda68d
parent11506300e6a64de2aaba2abbea23d69b98627412 (diff)
downloadpdfium-7b0be4ced5f3687e922fc9ed11a4c49fe9848221.tar.xz
Move m_CharCodes to local for crash investigation
m_CharCodes is getting corrupted and it's difficult to tell why. This moves it to a local variable before it is destroyed so that the corruption - which should be copied over - will be stored in the crash dump. Bug: 782215 Change-Id: Ifd09b21396bf28bca69f2b4082c61cbc4782e209 Reviewed-on: https://pdfium-review.googlesource.com/20530 Commit-Queue: Bruce Dawson <brucedawson@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
-rw-r--r--core/fpdfapi/page/cpdf_textobject.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/fpdfapi/page/cpdf_textobject.cpp b/core/fpdfapi/page/cpdf_textobject.cpp
index ac90eb1e50..0d60d50e2c 100644
--- a/core/fpdfapi/page/cpdf_textobject.cpp
+++ b/core/fpdfapi/page/cpdf_textobject.cpp
@@ -7,6 +7,7 @@
#include "core/fpdfapi/page/cpdf_textobject.h"
#include <algorithm>
+#include <utility>
#include "core/fpdfapi/font/cpdf_cidfont.h"
#include "core/fpdfapi/font/cpdf_font.h"
@@ -19,7 +20,11 @@ CPDF_TextObjectItem::~CPDF_TextObjectItem() = default;
CPDF_TextObject::CPDF_TextObject() {}
-CPDF_TextObject::~CPDF_TextObject() {}
+CPDF_TextObject::~CPDF_TextObject() {
+ // Move m_CharCodes to a local variable so it will be captured in crash dumps,
+ // to help with investigating crbug.com/782215.
+ auto char_codes_copy = std::move(m_CharCodes);
+}
size_t CPDF_TextObject::CountItems() const {
return m_CharCodes.size();