- 
    
Bug
 - 
    Resolution: Done
 - 
    
P1: Critical
 - 
    4.6.0
 - 
    None
 
- 
        dbaea6fa5a90742d89691685baa44a1a34598f21
 
QPixmap::loadFromData crashes on invalid data on X11,
here is the simple example which reproduces the bug:
#include <QtGui>
int main(int argc, char* argv[])
{
    QApplication app(argc, argv);
QByteArray data("some incorrect image data");
    QPixmap pixmap;
    pixmap.loadFromData(data);
    return 0;
}
Backtrace:
#0  0xb75ff40b in QImageData::checkForAlphaPixels (this=0x0) at depot/qt/qt/src/gui/image/qimage.cpp:273
#1  0xb764e9c7 in QX11AlphaDetector::hasAlpha (this=0xbff60b28) at depot/qt/qt/src/gui/image/qpixmap_x11.cpp:385
#2  0xb764ea1a in QX11AlphaDetector::hasXRenderAndAlpha (this=0xbff60b28) at depot/qt/qt/src/gui/image/qpixmap_x11.cpp:392
#3  0xb764665d in QX11PixmapData::fromImage (this=0x8088ec0, img=@0xbff60f5c, flags=
)
    at depot/qt/qt/src/gui/image/qpixmap_x11.cpp:443
#4  0xb76371e2 in QPixmapData::fromData (this=0x8088ec0, buf=0x80716a8 "some incorrect image data", len=25, format=0x0, flags=
)
    at depot/qt/qt/src/gui/image/qpixmapdata.cpp:132
#5  0xb762d365 in QPixmap::loadFromData (this=0xbff61010, buf=0x80716a8 "some incorrect image data", len=25, format=0x0, flags=
)
    at depot/qt/qt/src/gui/image/qpixmap.cpp:872
#6  0x08048a12 in QPixmap::loadFromData (this=0xbff61010, buf=@0xbff6101c, format=0x0, flags=
)
    at depot/qt/qt/src/gui/image/qpixmap.h:302
#7  0x080488c7 in main (argc=0, argv=0xb8035ff4) at testpixmap/main.cpp:10