summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-08-06 19:37:13 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-08-06 19:38:06 +0100
commit257ba1d2e0d8048c488459762b2bca033815767f (patch)
tree46d4a054dd4ed6fe3e60ad72b78655bf40e5dc6d
parent02b940396bb1fcb535e20dd5b5ada21ed7ce0ea7 (diff)
downloadrockbox-257ba1d2e0d8048c488459762b2bca033815767f.tar.gz
rockbox-257ba1d2e0d8048c488459762b2bca033815767f.tar.bz2
rockbox-257ba1d2e0d8048c488459762b2bca033815767f.zip
Fix possible negative fd in playlist.c
Change-Id: I59d88609ec3f20ec9f482a777396cd72be23a35b
-rw-r--r--apps/playlist.c2
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 */