summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render/render_int.h
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-08-31 15:23:46 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-08-31 15:23:46 -0700
commit9f810e7216c2dbb1a1ab090f1bee4207ecd871c0 (patch)
treee46c165bfbb041153ebc3cddfd20b39769aea826 /core/src/fpdfapi/fpdf_render/render_int.h
parentd0c36505eebd0a755f77f98676db0b5bad2f2496 (diff)
downloadpdfium-9f810e7216c2dbb1a1ab090f1bee4207ecd871c0.tar.xz
Remove the GetValidBpc check in application callers and move it to where m_bpc is assigned.
The problem of using GetValidBpc() in each function call is it could result in mismatch as seen in this case: in ContinueToLoadMask(), m_bpc is re-assigned to 1 if m_bImageMask==1 regardless of the value from GetValidBpc(). This will result in mismatch if another function use the value from GetValidBpc(). The solution could be checking m_bImageMask in another function to make sure m_bpc is consistent, but that makes the code too cumbersome. Also, we have to bring and are bringing in more and more GetValidBpc check, and this will continue with other buggy documents. So better to fix it now. The original rational to use GetValidBpc() in where m_bpc is used is to respect the "raw" data from parsing. However, if it will be ignored anyway and using value from GetValidBpc(), we'd better correct it at the very beginning. BUG=408541 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/518443002
Diffstat (limited to 'core/src/fpdfapi/fpdf_render/render_int.h')
-rw-r--r--core/src/fpdfapi/fpdf_render/render_int.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/fpdfapi/fpdf_render/render_int.h b/core/src/fpdfapi/fpdf_render/render_int.h
index fda3666871..af0e74e5e4 100644
--- a/core/src/fpdfapi/fpdf_render/render_int.h
+++ b/core/src/fpdfapi/fpdf_render/render_int.h
@@ -419,13 +419,13 @@ protected:
void LoadPalette();
FX_BOOL CreateDecoder();
void TranslateScanline24bpp(FX_LPBYTE dest_scan, FX_LPCBYTE src_scan) const;
- FX_DWORD GetValidBpc() const;
+ void ValidateBpc();
CPDF_Document* m_pDocument;
const CPDF_Stream* m_pStream;
CPDF_StreamAcc* m_pStreamAcc;
const CPDF_Dictionary* m_pDict;
CPDF_ColorSpace* m_pColorSpace;
- FX_DWORD m_Family, m_bpc, m_nComponents, m_GroupFamily;
+ FX_DWORD m_Family, m_bpc, m_bpc_orig, m_nComponents, m_GroupFamily;
FX_BOOL m_bLoadMask;
FX_BOOL m_bDefaultDecode, m_bImageMask, m_bColorKey;
DIB_COMP_DATA* m_pCompData;