From d69d406e096d9df587e9b263cc16553d17b63162 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 28 Feb 2011 00:59:44 +0000 Subject: 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 --- apps/hosted/notification.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'apps/hosted/notification.c') 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) char buf[200]; const char * ptitle = id3->title; - if (!ptitle) + if (!ptitle && *id3->path) { /* pass the filename as title if id3 info isn't available */ - ptitle = - strip_extension(buf, sizeof(buf), strrchr(id3->path,'/') + 1); + ptitle = strip_extension(buf, sizeof(buf), strrchr(id3->path,'/') + 1); } - title = e->NewStringUTF(env_ptr, ptitle); + title = e->NewStringUTF(env_ptr, ptitle ?: ""); artist = e->NewStringUTF(env_ptr, id3->artist ?: ""); album = e->NewStringUTF(env_ptr, id3->album ?: ""); -- cgit v1.2.3