bugXBoard - Bugs: bug #45775, infinite looping in...

 
 

bug #45775: infinite looping in CreatePNGBoard()

Submitter:  Matt Day <fjarlq>
Submitted:  Sun 16 Aug 2015 11:57:20 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Crash Status:  Fixed
Assigned to:  None Open/Closed:  Closed
Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 15 May 2021 05:12:27 AM UTC, comment #1: 

H.G. fixed this bug with git commit 713f3a53e.

Tim Mann <mann>
Group administrator
Sun 16 Aug 2015 11:57:20 PM UTC, original submission:  

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]++;


Matt Day <fjarlq>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #34664:  xboard-img.diff added by fjarlq (504B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mann (Posted a comment)
  • -email is unavailable- added by fjarlq (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-05-15 mann StatusNone Fixed
        Open/ClosedOpen Closed
    2015-08-16 fjarlq Attached File- Added xboard-img.diff, #34664

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code