diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-02-28 00:59:44 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-02-28 00:59:44 +0000 |
commit | d69d406e096d9df587e9b263cc16553d17b63162 (patch) | |
tree | 137c8ed34db4a5fc0f21bdb8ce5a2c5ca32061dd /apps/hosted/notification.c | |
parent | 613a26d507c8c79bc38710fbf4e6f619620e6f14 (diff) | |
download | rockbox-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/hosted/notification.c')
-rw-r--r-- | apps/hosted/notification.c | 7 |
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 | ||