POV-Ray : Newsgroups : povray.general : Overflow in accumulate_histogram Server Time
1 Nov 2024 16:22:06 EDT (-0400)
  Overflow in accumulate_histogram (Message 1 to 1 of 1)  
From: Peter J  Holzer
Subject: Overflow in accumulate_histogram
Date: 11 Jun 2000 18:02:01
Message: <slrn8k7sie.965.hjp-usenet@teal.h.hjp.at>
I found a bug in MegaPOV 0.5a (and probably also in 3.1g - as far as I
can see the code is the same in this regard):

If both mosaic preview (e.g., for radiosity) and cpu histogram are
enabled, accumulate_histogram can be called with x and y values larger
than the specified frame size. Since it doesn't sufficiently check the
values, it will write beyond allocated size of histogram_grid.

A possible fix is to enhance the check at the start of the function:

  if (y < 0 || x < 0 ||
      y >= Frame.Screen_Height || x >= Frame.Screen_Width)
  {
    return;
  }

	hp

-- 
   _  | Peter J. Holzer    | Nicht an Tueren mangelt es,
|_|_) | Sysadmin WSR       | sondern an der Einrichtung (aka Content).
| |   | hjp### [at] wsracat      |    -- Ale### [at] univieacat
__/   | http://www.hjp.at/ |       zum Thema Portale in at.linux


Post a reply to this message

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