Add another pixmap safety check in Shadow creation

Do not only check for null pixmaps but also that the
pixmap contains a 32 bit depth as we don't want shadows
without alpha.
icc-effect-5.14.5
Martin Gräßlin 2011-05-14 21:02:11 +02:00
parent a3962f895d
commit 911b037fe8
1 changed files with 1 additions and 1 deletions

View File

@ -100,7 +100,7 @@ bool Shadow::init(const QVector< long > &data)
{
for (int i=0; i<ShadowElementsCount; ++i) {
QPixmap pix = QPixmap::fromX11Pixmap(data[i]);
if (pix.isNull()) {
if (pix.isNull() || pix.depth() != 32) {
return false;
}
m_shadowElements[i] = pix.copy(0, 0, pix.width(), pix.height());