From ee6a17a36d437f5ada28b37fe1b2ae660400ab7d Mon Sep 17 00:00:00 2001 From: kugel Date: Mon, 28 Feb 2011 00:59:44 +0000 Subject: [PATCH] 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(-) diff --git a/apps/hosted/notification.c b/apps/hosted/notification.c index 4df5b9d6d..faa124786 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 ?: ""); -- 2.11.4.GIT