Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp

Issue 509613005: Fix a bug when looping through m_pCompData (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../../include/fxge/fx_ge.h" 7 #include "../../../include/fxge/fx_ge.h"
8 #include "../../../include/fxcodec/fx_codec.h" 8 #include "../../../include/fxcodec/fx_codec.h"
9 #include "../../../include/fpdfapi/fpdf_module.h" 9 #include "../../../include/fpdfapi/fpdf_module.h"
10 #include "../../../include/fpdfapi/fpdf_render.h" 10 #include "../../../include/fpdfapi/fpdf_render.h"
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 pSrcPixel = pSrcLine + (int)(src_x * orig_Not8Bpp); 1390 pSrcPixel = pSrcLine + (int)(src_x * orig_Not8Bpp);
1391 } 1391 }
1392 FX_LPBYTE pDestPixel = dest_scan + i * dest_Bpp; 1392 FX_LPBYTE pDestPixel = dest_scan + i * dest_Bpp;
1393 FX_ARGB argb; 1393 FX_ARGB argb;
1394 if (src_x == last_src_x) { 1394 if (src_x == last_src_x) {
1395 argb = last_argb; 1395 argb = last_argb;
1396 } else { 1396 } else {
1397 if (m_pColorSpace) { 1397 if (m_pColorSpace) {
1398 FX_BYTE color[4]; 1398 FX_BYTE color[4];
1399 if (!m_bDefaultDecode) { 1399 if (!m_bDefaultDecode) {
1400 for (int i = 0; i < orig_Bpp; i ++) { 1400 for (int i = 0; i < m_nComponents; i ++) {
1401 int color_value = (int)((m_pCompData[i].m_DecodeMin + m_pCompData[i].m_DecodeStep * (FX_FLOAT)pSrcPixel[i]) * 255.0f + 0.5f); 1401 int color_value = (int)((m_pCompData[i].m_DecodeMin + m_pCompData[i].m_DecodeStep * (FX_FLOAT)pSrcPixel[i]) * 255.0f + 0.5f);
1402 temp[i] = color_value > 255 ? 255 : (color_value < 0 ? 0 : color_value); 1402 temp[i] = color_value > 255 ? 255 : (color_value < 0 ? 0 : color_value);
1403 } 1403 }
1404 m_pColorSpace->TranslateImageLine(color, temp, 1, 0, 0, m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK ); 1404 m_pColorSpace->TranslateImageLine(color, temp, 1, 0, 0, m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK );
1405 } else { 1405 } else {
1406 if (bpc < 8) { 1406 if (bpc < 8) {
1407 int src_bit_pos = 0; 1407 int src_bit_pos = 0;
1408 if (src_x % 2) { 1408 if (src_x % 2) {
1409 src_bit_pos = 4; 1409 src_bit_pos = 4;
1410 } 1410 }
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 if (!m_bCached) { 1555 if (!m_bCached) {
1556 if (m_pBitmap) { 1556 if (m_pBitmap) {
1557 delete m_pBitmap; 1557 delete m_pBitmap;
1558 m_pBitmap = NULL; 1558 m_pBitmap = NULL;
1559 } 1559 }
1560 if (m_pMask) { 1560 if (m_pMask) {
1561 delete m_pMask; 1561 delete m_pMask;
1562 } 1562 }
1563 } 1563 }
1564 } 1564 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698