URL:
  <http://savannah.gnu.org/bugs/?45775>

                 Summary: infinite looping in CreatePNGBoard()
                 Project: XBoard
            Submitted by: fjarlq
            Submitted on: Sun 16 Aug 2015 05:57:20 PM MDT
                Category: None
                Severity: 3 - Normal
              Item Group: Crash
                  Status: None
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: None

    _______________________________________________________

Details:

If draw.c's CreatePNGBoard() is called with a file that doesn't exist, it
fails to notice the error and then gets stuck in an infinite loop.

I had a liteBackTextureFile defined in my $HOME/.xboardrc that referred to a
file that no longer exists. So, a workaround is to delete the old
liteBackTextureFile and darkBackTextureFile definitions from my
$HOME/.xboardrc.

CreatePNGBoard is calling cairo_image_surface_create_from_png() but then only
checking that the return value is nonzero. It should actually be checking that
cairo_surface_status(img) == CAIRO_STATUS_SUCCESS.

See attached patch.

The infinite loop is due to the 'w' and 'h' variables being equal to zero,
while squareSize is positive, so it gets stuck in this loop:


    while(squareSize > n[kind]*w || squareSize > n[kind]*h) n[kind]++;




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sun 16 Aug 2015 05:57:20 PM MDT  Name: xboard-img.diff  Size: 504B   By:
fjarlq

<http://savannah.gnu.org/bugs/download.php?file_id=34664>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45775>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Bug-XBoard mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-xboard

Reply via email to