KPixmapIO bug in ShmSegment
kvo--kde at seagha.be
Mon Feb 10 22:14:00 GMT 2003
Lubos Lunak wrote:
> On Saturday 08 of February 2003 14:53, Karl Vogel wrote:
>> void KPixmapIO::initXImage(int w, int h)
>> if (d->ximage && (w == d->ximage->width) && (h == d->ximage->height))
>> createXImage(w, h);
>> int size = d->ximage->bytes_per_line * d->ximage->height;
>> if (size > d->shmsize)
>> d->ximage->data = d->shminfo->shmaddr;
>> If createShmSegment() is unable attach the shm segment, then it sets
>> m_bShm to false. In this case d->shminfo->shmaddr is not valid! So there
>> needs to be a test written for this case.
>> Bumped onto this via:
> Do the attached patches help?
Your patch works. But I discovered another little bug in the shmat() call
that was causing a problem.
shmat() returns -1 for failure, however testing the return against < 0,
after converting it to char*, always returns false on my system (gcc
version 3.2 20020903 (Red Hat Linux 8.0 3.2-7))
Therefor it's better to compare with ==(char *)-1
(patch against your version is attached)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 418 bytes
Desc: not available
More information about the kde-core-devel