POV-Ray : Newsgroups : povray.unofficial.patches : Bug in Superpatch Isosurface(and a fix) Server Time
2 Sep 2024 14:16:34 EDT (-0400)
  Bug in Superpatch Isosurface(and a fix) (Message 1 to 1 of 1)  
From: Chris Huff
Subject: Bug in Superpatch Isosurface(and a fix)
Date: 24 Nov 1999 11:38:06
Message: <241119991141166973%chrishuff_99@yahoo.com>
I ran into this problem trying to compile the Superpatch for the Mac,
it apparently doesn't show up on other platforms. After a render which
uses isosurfaces, as POV tries to clean up the memory used, it will
crash. This is because it tries to free some memory from an isosurface
function which hasn't been allocated, because pnum is larger than
0(because it hasn't been initialized). It tries to do this around line
1045 of f_func.c, although that isn't the location of actual problem.

There are 2 places Func->pnum needs to be initialized, in f_expr.c. I
also added initializers for parm, needed in 3 places, although this is
apparently not a problem, "better safe than sorry".


Around line 181(the line numbers will be slightly off, because of
modifications I made):
       Func = (FUNCTION *) POV_MALLOC (sizeof(FUNCTION), "function");

    Func->parm = NULL;/*Chris Huff to prevent crash on cleanup*/


Around line 225:
       Func = (FUNCTION *) POV_MALLOC (sizeof(FUNCTION), "function");

    Func->parm = NULL;/*Chris Huff to prevent crash on cleanup*/
    Func->pnum = 0;/*Chris Huff to prevent crash on cleanup*/


And around line 468:
  Func = (FUNCTION *) POV_MALLOC (sizeof(FUNCTION), "function");

    Func->parm = NULL;/*Chris Huff to prevent crash on cleanup*/
    Func->pnum = 0;/*Chris Huff to prevent crash on cleanup*/

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.