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

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

Issue 354363003: Fix uninitialized RGB in translating scanline (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 6 years, 5 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 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 return; 985 return;
986 } else if (m_bpc == 8) { 986 } else if (m_bpc == 8) {
987 if (m_nComponents == m_pColorSpace->CountComponents()) 987 if (m_nComponents == m_pColorSpace->CountComponents())
988 m_pColorSpace->TranslateImageLine(dest_scan, src_scan, m_Width, m_Width, m_Height, 988 m_pColorSpace->TranslateImageLine(dest_scan, src_scan, m_Width, m_Width, m_Height,
989 m_bLoadMask && m_GroupFamily = = PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK); 989 m_bLoadMask && m_GroupFamily = = PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK);
990 return; 990 return;
991 } 991 }
992 } 992 }
993 CFX_FixedBufGrow<FX_FLOAT, 16> color_values1(m_nComponents); 993 CFX_FixedBufGrow<FX_FLOAT, 16> color_values1(m_nComponents);
994 FX_FLOAT* color_values = color_values1; 994 FX_FLOAT* color_values = color_values1;
995 FX_FLOAT R, G, B; 995 FX_FLOAT R = 0.0f, G = 0.0f, B = 0.0f;
996 if (m_bpc == 8) { 996 if (m_bpc == 8) {
997 int src_byte_pos = 0; 997 int src_byte_pos = 0;
998 int dest_byte_pos = 0; 998 int dest_byte_pos = 0;
999 for (int column = 0; column < m_Width; column ++) { 999 for (int column = 0; column < m_Width; column ++) {
1000 for (FX_DWORD color = 0; color < m_nComponents; color ++) { 1000 for (FX_DWORD color = 0; color < m_nComponents; color ++) {
1001 int data = src_scan[src_byte_pos ++]; 1001 int data = src_scan[src_byte_pos ++];
1002 color_values[color] = m_pCompData[color].m_DecodeMin + 1002 color_values[color] = m_pCompData[color].m_DecodeMin +
1003 m_pCompData[color].m_DecodeStep * data; 1003 m_pCompData[color].m_DecodeStep * data;
1004 } 1004 }
1005 if (m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK) { 1005 if (m_bLoadMask && m_GroupFamily == PDFCS_DEVICECMYK && m_Family == PDFCS_DEVICECMYK) {
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 if (!m_bCached) { 1507 if (!m_bCached) {
1508 if (m_pBitmap) { 1508 if (m_pBitmap) {
1509 delete m_pBitmap; 1509 delete m_pBitmap;
1510 m_pBitmap = NULL; 1510 m_pBitmap = NULL;
1511 } 1511 }
1512 if (m_pMask) { 1512 if (m_pMask) {
1513 delete m_pMask; 1513 delete m_pMask;
1514 } 1514 }
1515 } 1515 }
1516 } 1516 }
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