There is a BUG in function get_entry_property in contentdir.c (cvs and
previous versions).
if (strcmp(property, "upnp:class") == 0) {
if (has_entry_detail(entry, DETAIL_CHILDREN))
return xstrdup("object.container.storageFolder");
/*if (has_entry_detail(entry, DETAIL_URL))
return xstrdup("object.item.audioItem.audioBroadcast");*/
detail = get_entry_detail(entry, DETAIL_FILE);
switch (detail->data.file.item_class) {
case ITEM_AUDIO:
return xstrdup("object.item.audioItem.musicTrack");
case ITEM_IMAGE:
return xstrdup("object.item.imageItem.photo");
case ITEM_VIDEO:
return xstrdup("object.item.videoItem.movie");
case ITEM_PLAYLIST:
case ITEM_TEXT:
case ITEM_UNKNOWN:
default:
/* FIXME */
return NULL;
}
}
A NULL-pointer check is missing after the call to get_entry_detail.
In my case there were no details (detail == NULL) for an url in a playlist.
So the next line ended up in a segmentation fault.
The following patch for contentdir.c from cvs fixes this issue:
--- contentdir.c.dist 2007-11-29 21:06:53.000000000 +0100
+++ contentdir.c 2010-12-12 11:57:37.000000000 +0100
@@ -101,20 +101,24 @@
return xstrdup("object.item.audioItem.audioBroadcast");*/
detail = get_entry_detail(entry, DETAIL_FILE);
- switch (detail->data.file.item_class) {
- case ITEM_AUDIO:
- return xstrdup("object.item.audioItem.musicTrack");
- case ITEM_IMAGE:
- return xstrdup("object.item.imageItem.photo");
- case ITEM_VIDEO:
- return xstrdup("object.item.videoItem.movie");
- case ITEM_PLAYLIST:
- case ITEM_TEXT:
- case ITEM_UNKNOWN:
- default:
- /* FIXME */
- return NULL;
+ if(detail) {
+ switch (detail->data.file.item_class) {
+ case ITEM_AUDIO:
+ return xstrdup("object.item.audioItem.musicTrack");
+ case ITEM_IMAGE:
+ return xstrdup("object.item.imageItem.photo");
+ case ITEM_VIDEO:
+ return xstrdup("object.item.videoItem.movie");
+ case ITEM_PLAYLIST:
+ case ITEM_TEXT:
+ case ITEM_UNKNOWN:
+ default:
+ /* FIXME */
+ return NULL;
+ }
}
+ else
+ return NULL;
}
if (detail != NULL) {
Gerd
_______________________________________________
GMediaServer-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/gmediaserver-devel