From 822484b5f88d92dbcd567b1c2da38af1e720b56f Mon Sep 17 00:00:00 2001 From: tsepez Date: Mon, 11 Apr 2016 18:14:56 -0700 Subject: Remove CPDF_Object::GetConstString and overrides GetConstString() has sharp edges in that when applied to a CPDF_Number, it must return null whereas GetString() returns a the stringified number, because of the inability to control the lifetime of the underlying allocated string. Deleting this method showed several places where we actually wanted a *String, not a *StringC, so we were re-allocating a string we already had. Review URL: https://codereview.chromium.org/1879683002 --- core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp') diff --git a/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp index 11d9e524ee..f81f41c89f 100644 --- a/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp +++ b/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp @@ -350,11 +350,11 @@ FX_BOOL PDF_DataDecode(const uint8_t* src_buf, pParams = nullptr; for (size_t i = 0; i < pDecoders->GetCount(); i++) { - DecoderList.push_back(pDecoders->GetConstStringAt(i)); + DecoderList.push_back(pDecoders->GetStringAt(i)); ParamList.Add(pParams ? pParamsArray->GetDictAt(i) : nullptr); } } else { - DecoderList.push_back(pDecoder->GetConstString()); + DecoderList.push_back(pDecoder->GetString()); ParamList.Add(pParams ? pParams->GetDict() : nullptr); } uint8_t* last_buf = (uint8_t*)src_buf; -- cgit v1.2.3