On 13.01.2011, at 21:05, fltk-dev@easysw.com wrote:
> Author: manolo
> Date: 2011-01-13 12:05:32 -0800 (Thu, 13 Jan 2011)
> New Revision: 8273
> Log:
> Fixed WIN32 crash when printing with the test/mandelbrot demo.

> Modified: branches/branch-1.3/src/fl_draw_image_win32.cxx
> ===================================================================
> --- branches/branch-1.3/src/fl_draw_image_win32.cxx   2011-01-13 17:03:49 UTC 
> (rev 8272)
> +++ branches/branch-1.3/src/fl_draw_image_win32.cxx   2011-01-13 20:05:32 UTC 
> (rev 8273)
> @@ -184,7 +184,7 @@
>     if (size>  buffer_size) {
>       delete[] buffer;
>       buffer_size = size;
> -    buffer = new U32[(size+3)/4];
> +    buffer = new U32[(int)(1.02*   (size+3)/4)]; // some extra memory needed 
> when printing

Hmm, I don't know why there is the need for more memory, but
looking at the code and the intention of proper rounding, shouldn't
this be:

 > +    buffer = new U32[(int)(((1.02*size)+3)/4)]; // some extra memory needed 
when printing

Albrecht
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to