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

Side by Side Diff: core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp

Issue 379283003: Fix uninitialized nresults in GetRGB (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/fpdfapi/fpdf_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "../../../include/fxcodec/fx_codec.h" 9 #include "../../../include/fxcodec/fx_codec.h"
10 #include "pageint.h" 10 #include "pageint.h"
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 } 938 }
939 int nComps = m_pAltCS->CountComponents(); 939 int nComps = m_pAltCS->CountComponents();
940 CFX_FixedBufGrow<FX_FLOAT, 16> results(nComps); 940 CFX_FixedBufGrow<FX_FLOAT, 16> results(nComps);
941 for (int i = 0; i < nComps; i ++) { 941 for (int i = 0; i < nComps; i ++) {
942 results[i] = *pBuf; 942 results[i] = *pBuf;
943 } 943 }
944 m_pAltCS->GetRGB(results, R, G, B); 944 m_pAltCS->GetRGB(results, R, G, B);
945 return TRUE; 945 return TRUE;
946 } 946 }
947 CFX_FixedBufGrow<FX_FLOAT, 16> results(m_pFunc->CountOutputs()); 947 CFX_FixedBufGrow<FX_FLOAT, 16> results(m_pFunc->CountOutputs());
948 int nresults; 948 int nresults = 0;
949 m_pFunc->Call(pBuf, 1, results, nresults); 949 m_pFunc->Call(pBuf, 1, results, nresults);
950 if (nresults == 0) { 950 if (nresults == 0) {
951 return FALSE; 951 return FALSE;
952 } 952 }
953 if (m_pAltCS) { 953 if (m_pAltCS) {
954 m_pAltCS->GetRGB(results, R, G, B); 954 m_pAltCS->GetRGB(results, R, G, B);
955 return TRUE; 955 return TRUE;
956 } else { 956 } else {
957 R = G = B = 0; 957 R = G = B = 0;
958 return FALSE; 958 return FALSE;
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 PatternValue* pvalue = (PatternValue*)m_pBuffer; 1393 PatternValue* pvalue = (PatternValue*)m_pBuffer;
1394 return pvalue->m_nComps ? pvalue->m_Comps : NULL; 1394 return pvalue->m_nComps ? pvalue->m_Comps : NULL;
1395 } 1395 }
1396 FX_BOOL CPDF_Color::IsEqual(const CPDF_Color& other) const 1396 FX_BOOL CPDF_Color::IsEqual(const CPDF_Color& other) const
1397 { 1397 {
1398 if (m_pCS != other.m_pCS || m_pCS == NULL) { 1398 if (m_pCS != other.m_pCS || m_pCS == NULL) {
1399 return FALSE; 1399 return FALSE;
1400 } 1400 }
1401 return FXSYS_memcmp32(m_pBuffer, other.m_pBuffer, m_pCS->GetBufSize()) == 0; 1401 return FXSYS_memcmp32(m_pBuffer, other.m_pBuffer, m_pCS->GetBufSize()) == 0;
1402 } 1402 }
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