From: Alan W. I. <ai...@us...> - 2004-01-01 00:42:04
|
Update of /cvsroot/plplot/plplot/src In directory sc8-pr-cvs1:/tmp/cvs-serv30793 Modified Files: plshade.c Log Message: Fixed subtle bug for the corner case when pltr == NULL AND contouring is wanted. In this case, plshades is supposed to have the same interpretation as plshade, that is if pltr == NULL then transform the x and y index ranges to the ranges xmin to xmax, and ymin to ymax. Normally, that transformation was accomplished by simply passing on pltr to plshade to deal with using the correct transformation. But a complication arose for pltr == NULL when plshades was asked to also invoke plcont after its invocations of plshade. The plcont interpretation of pltr is different, and in fact it must be specified so the NULL was causing a segfault. The solution for the case of pltr == NULL and contouring is to generate the appropriate x and y grids ranging from xmin to xmax and ymin to ymax on the fly and set up the invocation of plcont from plshades appropriately. I copied the ideas for the necessary memory management from other plplot code and tested the result with valgrind to make sure no memory management issues have been introduced by this bug fix. |