diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2021-08-06 19:37:13 +0100 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2021-08-06 19:38:06 +0100 |
commit | 257ba1d2e0d8048c488459762b2bca033815767f (patch) | |
tree | 46d4a054dd4ed6fe3e60ad72b78655bf40e5dc6d | |
parent | 02b940396bb1fcb535e20dd5b5ada21ed7ce0ea7 (diff) |
Fix possible negative fd in playlist.c
Change-Id: I59d88609ec3f20ec9f482a777396cd72be23a35b
-rw-r--r-- | apps/playlist.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 2e28fc859d..49c52a9b7e 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -3707,7 +3707,7 @@ int playlist_save(struct playlist_info* playlist, char *filename, if (!rename(path, tmp_buf)) { fd = open_utf8(tmp_buf, O_RDONLY); - if (fsamefile(fd, playlist->fd) > 0) + if (fd >= 0 && fsamefile(fd, playlist->fd) > 0) { /* Replace the current playlist with the new one and update indices */ |