Put uint8_t vectors into data partition in fpdfsdk/
Change-Id: I95a95ba53057a6c4f25adb669e6fac33ac2501d1
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/68351
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_interactiveform.cpp b/fpdfsdk/cpdfsdk_interactiveform.cpp
index 098a917..c724af5 100644
--- a/fpdfsdk/cpdfsdk_interactiveform.cpp
+++ b/fpdfsdk/cpdfsdk_interactiveform.cpp
@@ -70,7 +70,8 @@
}
#endif // PDF_ENABLE_XFA
-bool FDFToURLEncodedData(std::vector<uint8_t>* pBuffer) {
+bool FDFToURLEncodedData(
+ std::vector<uint8_t, FxAllocAllocator<uint8_t>>* pBuffer) {
std::unique_ptr<CFDF_Document> pFDF = CFDF_Document::ParseMemory(*pBuffer);
if (!pFDF)
return true;
@@ -445,7 +446,8 @@
if (textBuf.IsEmpty())
return false;
- std::vector<uint8_t> buffer(textBuf.begin(), textBuf.end());
+ std::vector<uint8_t, FxAllocAllocator<uint8_t>> buffer(textBuf.begin(),
+ textBuf.end());
if (bUrlEncoded && !FDFToURLEncodedData(&buffer))
return false;
@@ -476,7 +478,8 @@
if (fdfBuffer.IsEmpty())
return false;
- std::vector<uint8_t> buffer(fdfBuffer.begin(), fdfBuffer.end());
+ std::vector<uint8_t, FxAllocAllocator<uint8_t>> buffer(fdfBuffer.begin(),
+ fdfBuffer.end());
if (bUrlEncoded && !FDFToURLEncodedData(&buffer))
return false;
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
index 7cb4a2c..a530182 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
@@ -13,6 +13,7 @@
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_seekablemultistream.h"
+#include "core/fxcrt/fx_memory_wrappers.h"
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_pageview.h"
#include "fpdfsdk/fpdfxfa/cpdfxfa_page.h"
@@ -313,7 +314,7 @@
return WideString();
int nLength = 2048;
- std::vector<uint8_t> pBuff(nLength);
+ std::vector<uint8_t, FxAllocAllocator<uint8_t>> pBuff(nLength);
nLength = m_pFormFillEnv->JS_appResponse(wsQuestion, wsTitle, wsDefaultAnswer,
WideString(), bMark, pBuff.data(),
nLength);