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


bug #45775: infinite looping in CreatePNGBoard()

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

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


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:

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 fjarlq (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-08-16 fjarlq Attached File- => Added xboard-img.diff, #34664

    Back to the top

    Powered by Savane 3.5