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

Side by Side Diff: core/fxge/dib/dib_int.h

Issue 2190283003: Fix a FPE in CStretchEngine::StartStretchHorz(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: signed Created 4 years, 4 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 | core/fxge/dib/fx_dib_engine.cpp » ('j') | 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 #ifndef CORE_FXGE_DIB_DIB_INT_H_ 7 #ifndef CORE_FXGE_DIB_DIB_INT_H_
8 #define CORE_FXGE_DIB_DIB_INT_H_ 8 #define CORE_FXGE_DIB_DIB_INT_H_
9 9
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 int src_len, 53 int src_len,
54 int src_min, 54 int src_min,
55 int src_max, 55 int src_max,
56 int flags); 56 int flags);
57 PixelWeight* GetPixelWeight(int pixel) { 57 PixelWeight* GetPixelWeight(int pixel) {
58 return (PixelWeight*)(m_pWeightTables + (pixel - m_DestMin) * m_ItemSize); 58 return (PixelWeight*)(m_pWeightTables + (pixel - m_DestMin) * m_ItemSize);
59 } 59 }
60 int m_DestMin, m_ItemSize; 60 int m_DestMin, m_ItemSize;
61 uint8_t* m_pWeightTables; 61 uint8_t* m_pWeightTables;
62 }; 62 };
63
63 class CStretchEngine { 64 class CStretchEngine {
64 public: 65 public:
65 CStretchEngine(IFX_ScanlineComposer* pDestBitmap, 66 CStretchEngine(IFX_ScanlineComposer* pDestBitmap,
66 FXDIB_Format dest_format, 67 FXDIB_Format dest_format,
67 int dest_width, 68 int dest_width,
68 int dest_height, 69 int dest_height,
69 const FX_RECT& clip_rect, 70 const FX_RECT& clip_rect,
70 const CFX_DIBSource* pSrcBitmap, 71 const CFX_DIBSource* pSrcBitmap,
71 int flags); 72 int flags);
72 ~CStretchEngine(); 73 ~CStretchEngine();
74
73 FX_BOOL Continue(IFX_Pause* pPause); 75 FX_BOOL Continue(IFX_Pause* pPause);
74 76
75 public: 77 FX_BOOL StartStretchHorz();
78 FX_BOOL ContinueStretchHorz(IFX_Pause* pPause);
79 void StretchVert();
80
76 FXDIB_Format m_DestFormat; 81 FXDIB_Format m_DestFormat;
77 int m_DestBpp, m_SrcBpp, m_bHasAlpha; 82 int m_DestBpp;
83 int m_SrcBpp;
84 int m_bHasAlpha;
78 IFX_ScanlineComposer* m_pDestBitmap; 85 IFX_ScanlineComposer* m_pDestBitmap;
79 int m_DestWidth, m_DestHeight; 86 int m_DestWidth, m_DestHeight;
80 FX_RECT m_DestClip; 87 FX_RECT m_DestClip;
81 uint8_t* m_pDestScanline; 88 uint8_t* m_pDestScanline;
82 uint8_t* m_pDestMaskScanline; 89 uint8_t* m_pDestMaskScanline;
83 FX_RECT m_SrcClip; 90 FX_RECT m_SrcClip;
84 const CFX_DIBSource* m_pSource; 91 const CFX_DIBSource* m_pSource;
85 uint32_t* m_pSrcPalette; 92 uint32_t* m_pSrcPalette;
86 int m_SrcWidth, m_SrcHeight; 93 int m_SrcWidth;
87 int m_SrcPitch, m_InterPitch; 94 int m_SrcHeight;
95 int m_SrcPitch;
96 int m_InterPitch;
88 int m_ExtraMaskPitch; 97 int m_ExtraMaskPitch;
89 uint8_t* m_pInterBuf; 98 uint8_t* m_pInterBuf;
90 uint8_t* m_pExtraAlphaBuf; 99 uint8_t* m_pExtraAlphaBuf;
91 int m_TransMethod; 100 int m_TransMethod;
92 int m_Flags; 101 int m_Flags;
93 CWeightTable m_WeightTable; 102 CWeightTable m_WeightTable;
94 int m_CurRow; 103 int m_CurRow;
95 FX_BOOL StartStretchHorz();
96 FX_BOOL ContinueStretchHorz(IFX_Pause* pPause);
97 void StretchVert();
98 int m_State; 104 int m_State;
99 }; 105 };
100 106
101 FX_RECT FXDIB_SwapClipBox(FX_RECT& clip, 107 FX_RECT FXDIB_SwapClipBox(FX_RECT& clip,
102 int width, 108 int width,
103 int height, 109 int height,
104 FX_BOOL bFlipX, 110 FX_BOOL bFlipX,
105 FX_BOOL bFlipY); 111 FX_BOOL bFlipY);
106 112
107 #endif // CORE_FXGE_DIB_DIB_INT_H_ 113 #endif // CORE_FXGE_DIB_DIB_INT_H_
OLDNEW
« no previous file with comments | « no previous file | core/fxge/dib/fx_dib_engine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698