Author: ayoung
Date: Tue Feb 23 00:58:45 2010
New Revision: 8548
URL: http://svn.slimdevices.com/jive?rev=8548&view=rev
Log:
bug 15753: Tile:loadImage() should return nil when the file path is non
readable
Return NULL if none of the images for a JiveTile can be found.
Does not test that they are actually loadable.
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/src/ui/jive_tile.c
Modified: 7.5/trunk/squeezeplay/src/squeezeplay/src/ui/jive_tile.c
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/src/ui/jive_tile.c?rev=8548&r1=8547&r2=8548&view=diff
==============================================================================
--- 7.5/trunk/squeezeplay/src/squeezeplay/src/ui/jive_tile.c (original)
+++ 7.5/trunk/squeezeplay/src/squeezeplay/src/ui/jive_tile.c Tue Feb 23
00:58:45 2010
@@ -416,7 +416,8 @@
paths[0] = (char *)path;
tile = jive_tile_load_tiles(paths);
- tile->flags |= TILE_FLAG_IMAGE;
+ if (tile)
+ tile->flags |= TILE_FLAG_IMAGE;
return tile;
}
@@ -474,6 +475,7 @@
JiveTile *tile;
char *fullpath;
int i;
+ int found = 0;
tile = calloc(sizeof(JiveTile), 1);
tile->refcount = 1;
@@ -492,9 +494,16 @@
}
tile->image[i] = _new_image(fullpath);
+ found++;
}
free(fullpath);
+
+ if (!found) {
+ LOG_ERROR(log_ui_draw, "No images found - no tile created");
+ free(tile);
+ return NULL;
+ }
return tile;
}
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins