POV-Ray : Newsgroups : povray.unofficial.patches : Warp transform crash. : Re: Warp transform crash. Server Time
1 Sep 2024 14:31:32 EDT (-0400)
  Re: Warp transform crash.  
From: Vahur Krouverk
Date: 14 Mar 2001 06:35:39
Message: <3AAF57AF.A8063E99@aetec.ee>
Fabien Mosen wrote:
> 
> This little scene make WinMegaPOV 0.7 crash at the end of the
> rendering.  Any other transform within warp causes the crash also.
> 
> #version unofficial MegaPov 0.7;
> 
> #include "colors.inc"
> 
> camera {location <10,10,8> direction z*6 look_at <0,1,0>}
> 
> light_source {<50,40,30> White*2}
> 
> #declare Pig_Wood = pigment {
>   wood
>   color_map {[0 Black][1 White]}
>   warp {turbulence .1 scale 5}
> }
> 
> sphere {<0,1,0>,1.7 pigment {Pig_Wood}}

Crash is caused by attempt to release warp's transformation structure
memory twice. And memory is released twice due to incorrect warp copy
implementation:
transformation matrix is copied in the beginning of Copy_Warps function,
but thereafter warp structure is copied with memcpy, so this pointer to
its own transformation matrix is overwritten and will point to
transformation matrix from source and memory, which is allocated for new
copy transformation, is lost.
In order to correct this, transformation copy should be performed after
warp copy, i.e. lines 

#ifdef TransformableWarpsPatch
    New->Warp_Transform = Copy_Transform(Old->Warp_Transform);
#endif
should be after switch block in Copy_Warps.


Post a reply to this message

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