[Qt-interest] QMacPixmapData::macCreatePixels bug when updating pixmap with a smaller image

Witteveen, Arnt ArntW at enfocus.com
Fri Apr 1 17:24:04 CEST 2011


I'm trying to debug a crash, and I have a feeling that there's a bug in
QMacPixmapData::macCreatePixels .

I see:
    if (pixels)
        memcpy(base_pixels, pixels, pixelsSize);

This is shortly after an if case where one of the paths is 

    base_pixels = static_cast<quint32 *>(malloc(numBytes));

And in my case, numBytes is smaller than pixelsSize. And I'm getting an
"EXC_BAD_ACCESS" according to the xcode debugger.

My feeling is that I'm trying to update a pixmap with an image that is
slightly larger (I'm calling aPixmap.convertFromImage( aQimage ); ) than
the current size of the pixmap. I see there was a bugreport for some
changes to this code before, for something that looks like the other way
around:

http://qt.gitorious.org/qt/qt/commit/cfa2c8edab18e810749ad7df29c0b3b4f83
f7140#comment_20901
http://bugreports.qt.nokia.com/browse/QTBUG-12873

Can anybody point me in the right direction here? Is this a bug, is this
not supposed to be called that way, .. ?

Thanks,
Arnt



More information about the Qt-interest-old mailing list