WPrefs: fix segfault when image not found
commit96c9ec185afc50ed660f0cd382f5636d87a5bdf9
authorDoug Torrance <dtorrance@monmouthcollege.edu>
Fri, 16 May 2014 03:12:57 +0000 (15 22:12 -0500)
committerCarlos R. Mafra <crmafra@gmail.com>
Sun, 18 May 2014 22:00:15 +0000 (18 23:00 +0100)
tree4845dfddd555332c41d020310b414d5d4a35653f
parent3b716620112e6e20e83a1574445933ce3a472089
WPrefs: fix segfault when image not found

Previously, when an image could not be loaded by WPrefs when rendering textures
for the Appearances panel, a segfault would occur.  This could happen, e.g., if
a user moved or deleted an image file without editing their ~/GNUstep/Defaults/
WindowMaker file.

This patch first checks if a texture contains an image, and if it does, it
checks to see if that image can be loaded.  If it can't, a solid black texture
is loaded instead.

The patch also has the added benefit of combining some of the code used for
rendering both pixmap and textured gradient textures.
WPrefs.app/Appearance.c