1
0
Fork 0
forked from len0rd/rockbox

Fix possible negative fd in playlist.c

Change-Id: I59d88609ec3f20ec9f482a777396cd72be23a35b
This commit is contained in:
Aidan MacDonald 2021-08-06 19:37:13 +01:00
parent 02b940396b
commit 257ba1d2e0

View file

@ -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 */