bug-freedink
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-freedink] Re: Freedink crash bug


From: Sylvain Beucler
Subject: [Bug-freedink] Re: Freedink crash bug
Date: Wed, 29 Jul 2009 22:29:09 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Hi,


Thanks for letting me know!


This was indeed fixed in the current snapshot:

  void dc_draw_screen(int script, int* yield, int* preturnint)
  {
    /* only refresh screen if not in a cut-scene */
    /* do it before draw_map_game() because that one calls
       kill_all_scripts(), which NULLifies rinfo[script] */
    if (rinfo[script]->sprite != 1000)
      *yield = 1;
    draw_map_game();
  }


Which means I should hurry up and make a new release :)

-- 
Sylvain

On Wed, Jul 29, 2009 at 12:57:01PM -0700, H. S. Teoh wrote:
> Hi, I'm playing freedink (1.08.20090120), and it frequently segfaults
> with the "Lyna's Story" dmod (lyna.dmod) when exiting the caves maps. I
> have traced the problem to the dc_draw_screen() function, where it
> dereferences a script pointer without checking whether it's NULL. So I
> added a check to the if-statement (see attached patch) and recompiled,
> and now it doesn't crash anymore.
> 
> I know my snapshot is older (I'm using the Debian package), but I
> thought I should send this patch to you just in case the same bug still
> exists in the latest snapshot.
> 
> Thanks for porting a great game!
> 
> 
> --T

> --- src/dinkc_bindings.c.OLD  2009-07-29 12:51:53.000000000 -0700
> +++ src/dinkc_bindings.c      2009-07-29 12:39:17.000000000 -0700
> @@ -689,7 +689,7 @@
>  {
>    draw_map_game();
>    /* only refresh screen if not in a cut-scene */
> -  if (rinfo[script]->sprite != 1000)
> +  if (rinfo[script] && rinfo[script]->sprite != 1000)
>      *yield = 1;
>  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]