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

Unified Diff: core/fxge/dib/fx_dib_engine.cpp

Issue 2404453003: Strengthen bounds check in CWeightTable::Calc * part II (Closed)
Patch Set: A better implementation of GetPixelWeightSize Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxge/dib/fx_dib_engine.cpp
diff --git a/core/fxge/dib/fx_dib_engine.cpp b/core/fxge/dib/fx_dib_engine.cpp
index 389cf239098f5a467dc20d5baabb255acf495b9b..3d3cd1904850661c2671b85773bea2d07b73a2c7 100644
--- a/core/fxge/dib/fx_dib_engine.cpp
+++ b/core/fxge/dib/fx_dib_engine.cpp
@@ -43,7 +43,7 @@ CWeightTable::~CWeightTable() {
}
size_t CWeightTable::GetPixelWeightSize() const {
- return m_dwWeightTablesSize / sizeof(int);
+ return (m_ItemSize - sizeof(int) * 2) / sizeof(int);
Lei Zhang 2016/10/14 23:51:54 How about: (m_ItemSize / sizeof(int)) - 2;
}
bool CWeightTable::Calc(int dest_len,
« 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