POV-Ray : Newsgroups : povray.binaries.images : Full CRASH!!! BUG!!! : Re: Full CRASH!!! BUG!!! Server Time
30 Jun 2024 12:56:57 EDT (-0400)
  Re: Full CRASH!!! BUG!!!  
From: Wolfgang Wieser
Date: 8 Jun 2004 15:01:37
Message: <40c60d10@news.povray.org>
Thorsten Froehlich wrote:

> In article <40c304ac@news.povray.org> , "IkA" <ixis.yandex.ru> wrote:
> 
>> A code:
> 
> What is this about???
> 
It took me one second to see that this is a bug report. So people like 
Thorsten should figure out in approximately 0.1 seconds :)

The crash is in
  void Post_Tnormal (TNORMAL *Tnormal)  (normal.cpp): 

          case NORMAL_TYPE:
-->         Map->Blend_Map_Entries[i].Vals.Tnormal->Flags |= 
              (Tnormal->Flags & DONT_SCALE_BUMPS_FLAG);

  with i=2, Map->Number_Of_Entries=3 and ...Tnormal=NULL. 

The problem probably begins in express.cpp, Parse_Blend_List(), near 
the end (line 2680): 

        case NORMAL_TYPE:
          Temp_Ent[i].Vals.Tnormal=Copy_Tnormal(Default_Texture->Tnormal);
          break;
    
Copy_Tnormal will return NULL because Default_Texture->Tnormal is NULL. 
Then, in Post_Tnormal it's a classical NULL pointer deref. 

Using if(Map->Blend_Map_Entries[i].Vals.Tnormal!=NULL) in the 
case NORMAL_TYPE in Post_Tnormal() will make the test scene trace 
successfully but I doubt that this is a good solution. 

Instead, using 

        case NORMAL_TYPE:
          Temp_Ent[i].Vals.Tnormal=Copy_Tnormal(Default_Texture->Tnormal);
-->       if(!Temp_Ent[i].Vals.Tnormal)  Count=i;
          break;

in Parse_Blend_List(), will also make the crash go away. This, however, 
means that Parse_Blend_List() no longer guarantees that the number 
of entries is equal to the Count argument. 

Just my 10 minute bug analysis (so no warranty for anything)...
Somebody with a bit more clue about that portion of the code should have 
a look at this. 

Cheers,
Wolfgang


Post a reply to this message

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