|
|
When trying out
function{
pigment {
image_map{
tga "bad.tga"
}
with SuperPatch, I found that if the image_map file doesn't exist
or can't be read (etc), and POV tries to do its Error exit routine,
it was crashing instead.
The reason seems to be that in Pattern_Structure,
the image is a member of a C union ('Vals') which I think
is being initialized to a value for 'gradient',
so when POV tries to free up the Pattern_Structure in
order to quit, it sees the image pointer as not NULL
and tries to free the image and causes SIGSEGV.
a fix is very simple in parstxtr.c:
static void Parse_Pattern (TPATTERN *New, int TPat_Type)
{
[ ... ]
CASE (IMAGE_MAP_TOKEN)
if (TPat_Type != PIGMENT_TYPE)
{
Only_In("image_map","pigment");
}
if (Old_Type==BITMAP_PATTERN)
{
Destroy_Image(Old_Image);
}
New->Type = BITMAP_PATTERN;
New->Frequency = 0.0;
/*a "fix"*/
New->Vals.Image=NULL;
/*---*/
Parse_Image_Map ((PIGMENT *)New);
EXIT
END_CASE
[ ... ]
Density_File is part of the same union and may have a similar
problem. but I haven't even tried to find out.
Post a reply to this message
|
|