diff options
author | Linus Walleij <triad@df.lth.se> | 2008-11-25 21:17:22 +0000 |
---|---|---|
committer | Linus Walleij <triad@df.lth.se> | 2008-11-25 21:17:22 +0000 |
commit | 73fecc4938e9197c6ea62f25cee9b779b3acae5b (patch) | |
tree | c814ca6361ec43898a87d2b614ee9a48a41129c4 | |
parent | 5b03d300180f24b941b48e1fa0cdc38ab1ba7473 (diff) | |
download | libmtp-73fecc4938e9197c6ea62f25cee9b779b3acae5b.tar.gz |
Handle Xi-Fi weirdness
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/libmtp.c | 7 |
2 files changed, 12 insertions, 3 deletions
@@ -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; |