From 257ba1d2e0d8048c488459762b2bca033815767f Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Fri, 6 Aug 2021 19:37:13 +0100 Subject: Fix possible negative fd in playlist.c Change-Id: I59d88609ec3f20ec9f482a777396cd72be23a35b --- apps/playlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps') 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 */ -- cgit v1.2.3