From 7b0be4ced5f3687e922fc9ed11a4c49fe9848221 Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Wed, 6 Dec 2017 22:32:41 +0000 Subject: 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 Reviewed-by: dsinclair --- core/fpdfapi/page/cpdf_textobject.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 +#include #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(); -- cgit v1.2.3