summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-08-27 13:13:42 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-08-27 13:13:42 -0700
commita67da71d5922877e1320f482bf86536d862961ed (patch)
treeac21b4c32523552c4c8057d1697f6abc0c03e7a3
parent96f87863739e2e6ebc76c6656fbb1101bdfc1378 (diff)
downloadpdfium-a67da71d5922877e1320f482bf86536d862961ed.tar.xz
Fix a bug when looping through m_pCompData
BUG=408154 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/509613005
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index 846ad827af..e02c011b86 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -1397,7 +1397,7 @@ void CPDF_DIBSource::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_
if (m_pColorSpace) {
FX_BYTE color[4];
if (!m_bDefaultDecode) {
- for (int i = 0; i < orig_Bpp; i ++) {
+ for (int i = 0; i < m_nComponents; i ++) {
int color_value = (int)((m_pCompData[i].m_DecodeMin + m_pCompData[i].m_DecodeStep * (FX_FLOAT)pSrcPixel[i]) * 255.0f + 0.5f);
temp[i] = color_value > 255 ? 255 : (color_value < 0 ? 0 : color_value);
}