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

Unified Diff: core/fpdfapi/fpdf_page/pageint.h

Issue 1990843004: Fix Undefined-shift in CPDF_SampledFunc::v_Init(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Fix bug 596530 as well Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: core/fpdfapi/fpdf_page/pageint.h
diff --git a/core/fpdfapi/fpdf_page/pageint.h b/core/fpdfapi/fpdf_page/pageint.h
index 6534186dc8cb45d524546d0d394facf1c8e77953..0a1468847dd28043cb84410604483e6f7c6e9ed4 100644
--- a/core/fpdfapi/fpdf_page/pageint.h
+++ b/core/fpdfapi/fpdf_page/pageint.h
@@ -366,14 +366,8 @@ class CPDF_DocPageData {
class CPDF_Function {
public:
- enum class Type {
- kType0Sampled,
- kType2ExpotentialInterpolation,
- kType3Stitching,
- kType4PostScript,
- };
-
static CPDF_Function* Load(CPDF_Object* pFuncObj);
+
virtual ~CPDF_Function();
FX_BOOL Call(FX_FLOAT* inputs,
uint32_t ninputs,
@@ -381,12 +375,10 @@ class CPDF_Function {
int& nresults) const;
uint32_t CountInputs() const { return m_nInputs; }
uint32_t CountOutputs() const { return m_nOutputs; }
- FX_FLOAT GetDomain(int i) const { return m_pDomains[i]; }
- FX_FLOAT GetRange(int i) const { return m_pRanges[i]; }
- Type GetType() const { return m_Type; }
protected:
- CPDF_Function(Type type);
+ CPDF_Function();
+
FX_BOOL Init(CPDF_Object* pObj);
virtual FX_BOOL v_Init(CPDF_Object* pObj) = 0;
virtual FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const = 0;
@@ -395,7 +387,6 @@ class CPDF_Function {
uint32_t m_nOutputs;
FX_FLOAT* m_pDomains;
FX_FLOAT* m_pRanges;
- Type m_Type;
};
class CPDF_ExpIntFunc : public CPDF_Function {
@@ -433,11 +424,12 @@ class CPDF_SampledFunc : public CPDF_Function {
FX_BOOL v_Init(CPDF_Object* pObj) override;
FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
- SampleEncodeInfo* m_pEncodeInfo;
- SampleDecodeInfo* m_pDecodeInfo;
+ private:
+ std::vector<SampleEncodeInfo> m_pEncodeInfo;
+ std::vector<SampleDecodeInfo> m_pDecodeInfo;
uint32_t m_nBitsPerSample;
uint32_t m_SampleMax;
- CPDF_StreamAcc* m_pSampleStream;
+ std::unique_ptr<CPDF_StreamAcc> m_pSampleStream;
};
class CPDF_StitchFunc : public CPDF_Function {
@@ -449,7 +441,7 @@ class CPDF_StitchFunc : public CPDF_Function {
FX_BOOL v_Init(CPDF_Object* pObj) override;
FX_BOOL v_Call(FX_FLOAT* inputs, FX_FLOAT* results) const override;
- std::vector<CPDF_Function*> m_pSubFunctions;
+ std::vector<std::unique_ptr<CPDF_Function>> m_pSubFunctions;
FX_FLOAT* m_pBounds;
FX_FLOAT* m_pEncode;
« core/fpdfapi/fpdf_page/fpdf_page_func.cpp ('K') | « core/fpdfapi/fpdf_page/fpdf_page_func.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698