summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-02-28 00:59:44 +0000
committerThomas Martitz <kugel@rockbox.org>2011-02-28 00:59:44 +0000
commitd69d406e096d9df587e9b263cc16553d17b63162 (patch)
tree137c8ed34db4a5fc0f21bdb8ce5a2c5ca32061dd /apps
parent613a26d507c8c79bc38710fbf4e6f619620e6f14 (diff)
downloadrockbox-d69d406e096d9df587e9b263cc16553d17b63162.tar.gz
rockbox-d69d406e096d9df587e9b263cc16553d17b63162.zip
Android: Fix crash when playback is passing invalid metadata around.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29454 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/hosted/notification.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/hosted/notification.c b/apps/hosted/notification.c
index 4df5b9d6d2..faa1247860 100644
--- a/apps/hosted/notification.c
+++ b/apps/hosted/notification.c
@@ -56,13 +56,12 @@ static void track_changed_callback(void *param)
56 56
57 char buf[200]; 57 char buf[200];
58 const char * ptitle = id3->title; 58 const char * ptitle = id3->title;
59 if (!ptitle) 59 if (!ptitle && *id3->path)
60 { /* pass the filename as title if id3 info isn't available */ 60 { /* pass the filename as title if id3 info isn't available */
61 ptitle = 61 ptitle = strip_extension(buf, sizeof(buf), strrchr(id3->path,'/') + 1);
62 strip_extension(buf, sizeof(buf), strrchr(id3->path,'/') + 1);
63 } 62 }
64 63
65 title = e->NewStringUTF(env_ptr, ptitle); 64 title = e->NewStringUTF(env_ptr, ptitle ?: "");
66 artist = e->NewStringUTF(env_ptr, id3->artist ?: ""); 65 artist = e->NewStringUTF(env_ptr, id3->artist ?: "");
67 album = e->NewStringUTF(env_ptr, id3->album ?: ""); 66 album = e->NewStringUTF(env_ptr, id3->album ?: "");
68 67