diff options
author | Lei Zhang <thestig@chromium.org> | 2018-03-05 15:16:37 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-03-05 15:16:37 +0000 |
commit | 1330ebbff8a31beb19d38b2a680625a19240a4f0 (patch) | |
tree | 2699dde2f80b46527b5dd40184efe3ac927529fa /core/fpdfapi/page/cpdf_image.cpp | |
parent | 40482e6f06eac0c5089e44df2d62881127eeeb3e (diff) | |
download | pdfium-1330ebbff8a31beb19d38b2a680625a19240a4f0.tar.xz |
Make FPDFBitmap_GetFormat() work for JBIG images.
BUG=pdfium:945
Change-Id: I2a880e747b6f5a2fabed4d34ce47b69ff589ce3f
Reviewed-on: https://pdfium-review.googlesource.com/27814
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_image.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_image.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/fpdfapi/page/cpdf_image.cpp b/core/fpdfapi/page/cpdf_image.cpp index 8ce4185446..b74de62250 100644 --- a/core/fpdfapi/page/cpdf_image.cpp +++ b/core/fpdfapi/page/cpdf_image.cpp @@ -331,7 +331,13 @@ RetainPtr<CFX_DIBSource> CPDF_Image::LoadDIBSource() const { if (!source->Load(m_pDocument.Get(), m_pStream.Get())) return nullptr; - return source; + if (!source->IsJBigImage()) + return source; + + CPDF_DIBSource::LoadState ret = CPDF_DIBSource::LoadState::kContinue; + while (ret == CPDF_DIBSource::LoadState::kContinue) + ret = source->ContinueLoadDIBSource(nullptr); + return ret == CPDF_DIBSource::LoadState::kSuccess ? source : nullptr; } RetainPtr<CFX_DIBSource> CPDF_Image::DetachBitmap() { |