Disallow more CFX_ScanlineCompositor conversions. Disallow the combination where the destination bitmap format uses palettes and the reverse byte order bit is set. CFX_ScanlineCompositor is not designed to handle this case, and will end up doing the wrong thing. e.g. for a source format of `FXDIB_Argb` and destination format of `FXDIB_8bppRgba`, it will call CompositeRow_Rgb2Argb_NoBlend_NoClip_RgbByteOrder(), which is completely nonsensical. Bug: chromium:1139825 Change-Id: I6a4d7a402d4006d7454188cf9f66daa04ed98062 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/75470 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fxge/dib/cfx_scanlinecompositor.cpp b/core/fxge/dib/cfx_scanlinecompositor.cpp index 5e25641..ab62044 100644 --- a/core/fxge/dib/cfx_scanlinecompositor.cpp +++ b/core/fxge/dib/cfx_scanlinecompositor.cpp
@@ -2753,7 +2753,7 @@ if (GetBppFromFormat(dest_format) == 1) return false; - if (m_bRgbByteOrder && m_DestFormat == FXDIB_Format::k8bppMask) + if (m_bRgbByteOrder && GetBppFromFormat(m_DestFormat) == 8) return false; if (m_SrcFormat == FXDIB_Format::k1bppMask ||