do not reinterpret_cast insufficient data

BUG: 341010
FIXED-IN: 5.5
REVIEW: 125513
This commit is contained in:
Thomas Lübking 2015-01-18 00:51:14 +01:00
parent 7e72aee474
commit 7a38b21f49

View file

@ -122,7 +122,7 @@ void KscreenEffect::propertyNotify(EffectWindow *window, long int atom)
return;
}
QByteArray byteData = effects->readRootProperty(m_atom, XCB_ATOM_CARDINAL, 32);
auto *data = reinterpret_cast<uint32_t *>(byteData.data());
const uint32_t *data = byteData.isEmpty() ? nullptr : reinterpret_cast<const uint32_t *>(byteData.data());
if (!data // Property was deleted
|| data[0] == 0) { // normal state - KWin should have switched to it
if (m_state != StateNormal) {