summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Walleij <triad@df.lth.se>2008-11-25 21:17:22 +0000
committerLinus Walleij <triad@df.lth.se>2008-11-25 21:17:22 +0000
commit73fecc4938e9197c6ea62f25cee9b779b3acae5b (patch)
treec814ca6361ec43898a87d2b614ee9a48a41129c4
parent5b03d300180f24b941b48e1fa0cdc38ab1ba7473 (diff)
downloadlibmtp-73fecc4938e9197c6ea62f25cee9b779b3acae5b.tar.gz
Handle Xi-Fi weirdness
-rw-r--r--ChangeLog8
-rw-r--r--src/libmtp.c7
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 4d1635d..2ebd2e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,16 @@
+2008-11-25 Linus Walleij <triad@df.lth.se>
+
+ * src/libmtp.c: fix a bug on handling folder children with an illegal
+ ID of 0. Occured in the ZEN Xi-Fi in the "Recordings" folder, when
+ that is created on the device.
+
2008-11-17 Alistair Boyle <alistair.js.boyle@gmail.com>
- * Release libmtp 0.3.5
* configure.ac: change release to 0.3.5.
* libmtp.c: change metadata const*const to *const to allow playlist_id
to be modified by LIBMTP_Update_Playlist. (Samsung playlists)
* libmtp.h.in: match libmtp.c
-
2008-11-11 Linus Walleij <triad@df.lth.se>
* src/libmtp.c: allow for playlists with zero tracks on them,
diff --git a/src/libmtp.c b/src/libmtp.c
index 015a8c6..a51df56 100644
--- a/src/libmtp.c
+++ b/src/libmtp.c
@@ -5380,7 +5380,12 @@ static LIBMTP_folder_t *get_subfolders_for_folder(PTPParams *params, uint32_t pa
}
// Recursively get children for this child. Perhaps NULL.
- folder->child = get_subfolders_for_folder(params, folder->folder_id);
+ if (folder->child == 0) {
+ // The Creative Zen Xi-Fi has this particular bug using an invalid child ID
+ printf("Weirdo folder child with ID 0 encountered, not descending.\n");
+ } else {
+ folder->child = get_subfolders_for_folder(params, folder->folder_id);
+ }
}
return retfolders;