POV-Ray : Newsgroups : povray.general : Bug in source/lighting.cpp InitMallocPools() : Bug in source/lighting.cpp InitMallocPools() Server Time
1 Aug 2024 06:22:24 EDT (-0400)
  Bug in source/lighting.cpp InitMallocPools()  
From: Paul Bowen-Huggett
Date: 8 Feb 2006 15:58:23
Message: <PM00040C4EC06AA8F8@82-46-5-87.stb.ubr03.azte.blueyonder.co.uk>
Hi,

I've been working on an experimental port of Povray 3.6.1 to a new platform:
one on which a long is 64-bits, and a pointer 32. I've been tracking down an
error due to the end of a block of memory being over-written and have narrowed
it down to the file source/lighting.cpp. This contains the following code in
InitMallocPools():

  ShadowMediaListPoolSize = (long *)POV_MALLOC(MaxMediaPoolDepth*sizeof(long
*), "temp media list");
  LightingMediaListPoolSize = (long *)POV_MALLOC(MaxMediaPoolDepth*sizeof(long
*), "temp media list");
  MediaIntervalPoolSize = (long *)POV_MALLOC(MaxMediaPoolDepth*sizeof(long *),
"temp media list");

The fix would obviously be to replace the "*sizeof (long *)" with
"sizeof(long)":

  ShadowMediaListPoolSize = (long *)POV_MALLOC(MaxMediaPoolDepth*sizeof(long),
"temp media list");
  LightingMediaListPoolSize = (long
*)POV_MALLOC(MaxMediaPoolDepth*sizeof(long), "temp media list");
  MediaIntervalPoolSize = (long *)POV_MALLOC(MaxMediaPoolDepth*sizeof(long),
"temp media list");

Apologies if I'm not reporting this to the right place, or it was fixed long
ago...!

HTH,
Paul


Post a reply to this message

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