summaryrefslogtreecommitdiff
path: root/core/fxge/dib
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-03-05 15:16:37 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-05 15:16:37 +0000
commit1330ebbff8a31beb19d38b2a680625a19240a4f0 (patch)
tree2699dde2f80b46527b5dd40184efe3ac927529fa /core/fxge/dib
parent40482e6f06eac0c5089e44df2d62881127eeeb3e (diff)
downloadpdfium-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/fxge/dib')
-rw-r--r--core/fxge/dib/cfx_dibsource.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/fxge/dib/cfx_dibsource.cpp b/core/fxge/dib/cfx_dibsource.cpp
index f96ca1e074..104b3caf96 100644
--- a/core/fxge/dib/cfx_dibsource.cpp
+++ b/core/fxge/dib/cfx_dibsource.cpp
@@ -1225,12 +1225,13 @@ bool CFX_DIBSource::ConvertBuffer(
}
case FXDIB_8bppRgb:
case FXDIB_8bppRgba: {
- if (bpp == 8 && !pSrcBitmap->GetPalette()) {
+ const bool bpp_1_or_8 = (bpp == 1 || bpp == 8);
+ if (bpp_1_or_8 && !pSrcBitmap->GetPalette()) {
return ConvertBuffer(FXDIB_8bppMask, dest_buf, dest_pitch, width,
height, pSrcBitmap, src_left, src_top, p_pal);
}
p_pal->reset(FX_Alloc(uint32_t, 256));
- if ((bpp == 1 || bpp == 8) && pSrcBitmap->GetPalette()) {
+ if (bpp_1_or_8 && pSrcBitmap->GetPalette()) {
ConvertBuffer_Plt2PltRgb8(dest_buf, dest_pitch, width, height,
pSrcBitmap, src_left, src_top, p_pal->get());
return true;