I've been digging into a segfault that was preventing 'make doc' from
operating correctly, and pinned it down to this code:

src/modules/Image/colortable.c:2010
-           rnd->u.refs++;
+           ++*rnd->u.refs;

and corresponding decrementing of the refcount. The count appears to
be a pointer, not a direct integer, so it looks like it ought to be
dereferenced here.

Not 100% sure the fix is correct though, so I pushed to branch
rosuav/colortable-segfault instead of directly to 8.1. Can someone
check it, please?

Test case, cribbed from the code behind 'make doc':

#define IMAGE_DIR "/home/rosuav/pike/refdoc/src_images/"
object lena() {
    catch { return Image.load(IMAGE_DIR + "image_ill.pnm"); };
    catch { return Image.load(IMAGE_DIR + "lena.ppm"); };
    catch { return Image.load(IMAGE_DIR + "lenna.rs"); };
    return Image.load(IMAGE_DIR + "lena.gif");
}
int main()
{
    object c=Image.Colortable(lena(),2)->randomcube(60,60,60);
    c*lena();
}

ChrisA

Reply via email to