diff options
author | waker <wakeroid@gmail.com> | 2012-01-10 21:58:57 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-01-10 21:58:57 +0100 |
commit | 0378e1f1f82bee0660b3a6020d378cae99cf77fb (patch) | |
tree | fe8ec6dcce600f4debcb24a5e284cd097dc905ec /plugins | |
parent | 84844f6742414fc7d2b1218bb285e9f3b21e7576 (diff) |
fixed crash when .pls playlist references non-existing local file
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/m3u/m3u.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/m3u/m3u.c b/plugins/m3u/m3u.c index 204719f6..b333cdbc 100644 --- a/plugins/m3u/m3u.c +++ b/plugins/m3u/m3u.c @@ -192,11 +192,13 @@ pls_insert_file (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, c trace ("pls_insert_file: adding file %s\n", fullpath); it = deadbeef->plt_insert_file (plt, after, fullpath, pabort, cb, user_data); } - if (length[0]) { - deadbeef->plt_set_item_duration (plt, it, atoi (length)); - } - if (title[0]) { - deadbeef->pl_replace_meta (it, "title", title); + if (it) { + if (length[0]) { + deadbeef->plt_set_item_duration (plt, it, atoi (length)); + } + if (title[0]) { + deadbeef->pl_replace_meta (it, "title", title); + } } return it; } |