Menu

#1330 AIX image buffer allocation failure

obsolete: 8.4.0
closed-duplicate
5
2002-10-25
2002-10-24
Ed Hume
No

On an AIX 4.3 system the command "image create
photo" fails in file tkImgPhoto.c, function,
ImgPhotoSetSize, line 2656, when attemptckalloc() is
called. AIX and some other systems (Tru64) return
NULL from an alloc call for 0 size. This problem affects
only Tk 8.4. The fix that I have successfully tested is

if ((width != masterPtr->width) || (height != masterPtr-
>height) || (masterPtr->pix24 == NULL) {
unsigned size;
size = height * pitch;
if (size > 0) {
newPix24 = (unsigned char *) attemptckalloc(size);
if (newPix24 == NULL) { return TCL_ERROR; }
}
else { newPix24 = NULL; }
}

Discussion

  • Donal K. Fellows

    • milestone: 241711 --> obsolete: 8.4.0
    • assigned_to: nobody --> dkf
    • status: open --> closed-duplicate
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    This bug was fixed for the 8.4.1 release