From a67da71d5922877e1320f482bf86536d862961ed Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Wed, 27 Aug 2014 13:13:42 -0700 Subject: Fix a bug when looping through m_pCompData BUG=408154 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/509613005 --- core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/src') 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); } -- cgit v1.2.3