bug-xboard
[Top][All Lists]
Advanced

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

[Bug-XBoard] [bug #45775] infinite looping in CreatePNGBoard()


From: Matt Day
Subject: [Bug-XBoard] [bug #45775] infinite looping in CreatePNGBoard()
Date: Sun, 16 Aug 2015 23:57:21 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36

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/




reply via email to

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