Skip to content

Commit

Permalink
fix plt_load_from_buffer
Browse files Browse the repository at this point in the history
plt_load_from_buffer calls _plt_load_from_file with fname=NULL,
which basically just unconditionally crashes.

Anyway, drag-and-drop from the sidebar into a playlist was
broken on macOS beacause of this. Seems to be fine with this fix.
  • Loading branch information
percontation authored and Oleksiy-Yakovenko committed Sep 17, 2024
1 parent 2a5b3cf commit a0f9588
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/playlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -2445,8 +2445,8 @@ _plt_load_from_file (playlist_t *plt, const char *fname, ddb_file_handle_t *fp,
goto load_fail;
}

char *slash = strrchr (fname, '/');
if (slash && fname) {
char *slash = fname ? strrchr (fname, '/') : NULL;
if (slash) {
dname = strndup (fname, slash - fname);
}

Expand Down

0 comments on commit a0f9588

Please sign in to comment.