From ef81390393ef5fed1ba168cff081d459eed9f260 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 1 Mar 2017 00:32:20 -0800 Subject: Fix infinite loops in CPDF_MeshStream. BUG=chromium:690501 Change-Id: I74b09d90a8082554a67f737eb6adc3bff82ed93e Reviewed-on: https://pdfium-review.googlesource.com/2889 Commit-Queue: dsinclair Reviewed-by: dsinclair --- core/fpdfapi/page/cpdf_meshstream.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'core/fpdfapi/page/cpdf_meshstream.h') diff --git a/core/fpdfapi/page/cpdf_meshstream.h b/core/fpdfapi/page/cpdf_meshstream.h index 24f1d66cfd..d40de4a013 100644 --- a/core/fpdfapi/page/cpdf_meshstream.h +++ b/core/fpdfapi/page/cpdf_meshstream.h @@ -42,11 +42,17 @@ class CPDF_MeshStream { bool Load(); + bool CanReadFlag() const; + bool CanReadCoords() const; + bool CanReadColor() const; + uint32_t ReadFlag(); CFX_PointF ReadCoords(); std::tuple ReadColor(); - CPDF_MeshVertex ReadVertex(const CFX_Matrix& pObject2Bitmap, uint32_t* flag); + bool ReadVertex(const CFX_Matrix& pObject2Bitmap, + CPDF_MeshVertex* vertex, + uint32_t* flag); bool ReadVertexRow(const CFX_Matrix& pObject2Bitmap, int count, CPDF_MeshVertex* vertex); -- cgit v1.2.3