summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/fpdfapi/render/cpdf_dibsource.cpp6
-rw-r--r--core/fpdfapi/render/fpdf_render_loadimage_embeddertest.cpp9
-rw-r--r--testing/resources/bug_1087.pdfbin0 -> 1574 bytes
3 files changed, 13 insertions, 2 deletions
diff --git a/core/fpdfapi/render/cpdf_dibsource.cpp b/core/fpdfapi/render/cpdf_dibsource.cpp
index 3a4ca02cc2..d1eba2e467 100644
--- a/core/fpdfapi/render/cpdf_dibsource.cpp
+++ b/core/fpdfapi/render/cpdf_dibsource.cpp
@@ -323,8 +323,10 @@ CPDF_DIBSource::LoadState CPDF_DIBSource::ContinueLoadDIBSource(
LoadState iContinueStatus = LoadState::kSuccess;
if (m_bHasMask) {
- iContinueStatus = ContinueLoadMaskDIB(pPause);
- m_Status = LoadState::kContinue;
+ if (ContinueLoadMaskDIB(pPause) == LoadState::kContinue) {
+ iContinueStatus = LoadState::kContinue;
+ m_Status = LoadState::kContinue;
+ }
}
if (iContinueStatus == LoadState::kContinue)
return LoadState::kContinue;
diff --git a/core/fpdfapi/render/fpdf_render_loadimage_embeddertest.cpp b/core/fpdfapi/render/fpdf_render_loadimage_embeddertest.cpp
index 5103d787bd..e3bd297afb 100644
--- a/core/fpdfapi/render/fpdf_render_loadimage_embeddertest.cpp
+++ b/core/fpdfapi/render/fpdf_render_loadimage_embeddertest.cpp
@@ -40,3 +40,12 @@ TEST_F(FPDFRenderLoadImageEmbeddertest, Bug_603518) {
CompareBitmap(bitmap.get(), 749, 749, "b9e75190cdc5edf0069a408744ca07dc");
UnloadPage(page);
}
+
+TEST_F(FPDFRenderLoadImageEmbeddertest, Bug_1087) {
+ EXPECT_TRUE(OpenDocument("bug_1087.pdf"));
+ FPDF_PAGE page = LoadPage(0);
+ ASSERT_TRUE(page);
+ ScopedFPDFBitmap bitmap = RenderLoadedPage(page);
+ CompareBitmap(bitmap.get(), 548, 238, "2aac40afa121feb0f38883cb04a55001");
+ UnloadPage(page);
+}
diff --git a/testing/resources/bug_1087.pdf b/testing/resources/bug_1087.pdf
new file mode 100644
index 0000000000..73bc682c4a
--- /dev/null
+++ b/testing/resources/bug_1087.pdf
Binary files differ