summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_meshstream.h
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-07-14 16:39:39 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-17 13:59:25 +0000
commitf768baf129fcafc4342193477e0c41c082ef5ca5 (patch)
tree67f9bb33fd982eaf1816f2b70ba230162910acc0 /core/fpdfapi/page/cpdf_meshstream.h
parent3a4ebcc7c490eba0c22892ab04d1730c350fd0c0 (diff)
downloadpdfium-f768baf129fcafc4342193477e0c41c082ef5ca5.tar.xz
Let CPDF_MeshStream::ReadVertexRow return a vector
In this CL, CPDF_MeshStream::ReadVertexRow returns a vector. The vector size is not allocated in advance to prevent OOM attacks, since the size is given as an input to the PDF. Bug: chromium:735248 Change-Id: I3e2b020896f24715af5dfd9aa18768e6d64d6f76 Reviewed-on: https://pdfium-review.googlesource.com/7950 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_meshstream.h')
-rw-r--r--core/fpdfapi/page/cpdf_meshstream.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/fpdfapi/page/cpdf_meshstream.h b/core/fpdfapi/page/cpdf_meshstream.h
index af636a964d..60c47790a4 100644
--- a/core/fpdfapi/page/cpdf_meshstream.h
+++ b/core/fpdfapi/page/cpdf_meshstream.h
@@ -54,9 +54,8 @@ class CPDF_MeshStream {
bool ReadVertex(const CFX_Matrix& pObject2Bitmap,
CPDF_MeshVertex* vertex,
uint32_t* flag);
- bool ReadVertexRow(const CFX_Matrix& pObject2Bitmap,
- int count,
- CPDF_MeshVertex* vertex);
+ std::vector<CPDF_MeshVertex> ReadVertexRow(const CFX_Matrix& pObject2Bitmap,
+ int count);
CFX_BitStream* BitStream() { return &m_BitStream; }
uint32_t ComponentBits() const { return m_nComponentBits; }