summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2010-04-28 09:57:39 +0200
committerDanny Baumann <dannybaumann@web.de>2010-04-28 09:57:39 +0200
commit1d038ec135a85d98134fcc221ef75ffbf06adaee (patch)
tree2747b370b9e5214e41783273ef063c427052bf8a /src
parenta4c0bd14fe7011a056f25b4875534fac411c07a0 (diff)
parent47194772a3f233afec289064806e7addc9b4d0b5 (diff)
downloadzcomp-1d038ec135a85d98134fcc221ef75ffbf06adaee.tar.gz
zcomp-1d038ec135a85d98134fcc221ef75ffbf06adaee.tar.bz2
Merge branch 'master' of git+ssh://git.compiz-fusion.org/git/compiz/core
Diffstat (limited to 'src')
-rw-r--r--src/option.cpp2
-rw-r--r--src/window.cpp12
2 files changed, 9 insertions, 5 deletions
diff --git a/src/option.cpp b/src/option.cpp
index a301e7d..1fb69f0 100644
--- a/src/option.cpp
+++ b/src/option.cpp
@@ -486,7 +486,7 @@ CompOption::Restriction::Restriction () :
{
}
-CompOption::Restriction::Restriction (const CompOption::Restriction::Restriction &r) :
+CompOption::Restriction::Restriction (const CompOption::Restriction &r) :
priv (new PrivateRestriction (*r.priv))
{
}
diff --git a/src/window.cpp b/src/window.cpp
index eb5243f..6072f96 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -4064,18 +4064,22 @@ CompWindow::getIcon (int width,
if (result == Success && data)
{
- CARD32 *p;
- CARD32 alpha, red, green, blue;
- int iw, ih, j;
+ CARD32 *p;
+ CARD32 alpha, red, green, blue;
+ unsigned long iw, ih;
for (i = 0; i + 2 < n; i += iw * ih + 2)
{
unsigned long *idata = (unsigned long *) data;
+ unsigned long j;
iw = idata[i];
ih = idata[i + 1];
- if (iw * ih + 2 > (int) (n - i))
+ /* iw * ih may be larger than the value range of unsigned
+ * long, so better do some checking for extremely weird
+ * icon sizes first */
+ if (iw > 2048 || ih > 2048 || iw * ih + 2 > n - i)
break;
if (iw && ih)