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

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

Issue 2322903002: Strengthen bounds check in CWeightTable::Calc. (Closed)
Patch Set: Created 4 years, 3 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 88b0d4b271632ce2b7f6aac696e68c34cf6d2ae0..c270661002032def61fc6c1095f98a0494acf2b7 100644
--- a/core/fxge/dib/fx_dib_engine.cpp
+++ b/core/fxge/dib/fx_dib_engine.cpp
@@ -63,6 +63,7 @@ bool CWeightTable::Calc(int dest_len,
m_dwWeightTablesSize = (dest_max - dest_min) * m_ItemSize + 4;
m_pWeightTables = FX_TryAlloc(uint8_t, m_dwWeightTablesSize);
+ m_dwWeightTablesSize /= sizeof(int);
Lei Zhang 2016/09/23 21:32:01 I think it's weird for a variable to have 2 differ
if (!m_pWeightTables)
return false;
« 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