summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2023-03-26 19:08:08 +0200
committerChristian Soffke <christian.soffke@gmail.com>2023-04-01 08:19:22 -0400
commit287747591e9feafa0d5946e3f7614cec3987e2dc (patch)
tree544cd42d6238a933bb180bf59a59bf5f9229df34
parent2456d28e2176b1a1616aa62c5956fa3c2fac0ee3 (diff)
downloadrockbox-287747591e.tar.gz
rockbox-287747591e.zip
plugins: vbrfix: Fix fd leak & error handling
- mp3info returns true for error - fd wasn't closed for non-vbr files Change-Id: I5432025d3384ddf92ed0a478587dcc1715fcf524
-rw-r--r--apps/plugins/vbrfix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/plugins/vbrfix.c b/apps/plugins/vbrfix.c
index 88f0a6579e..79fa134499 100644
--- a/apps/plugins/vbrfix.c
+++ b/apps/plugins/vbrfix.c
@@ -150,7 +150,7 @@ static bool vbr_fix(const char *selected_file)
xingupdate(0);
rc = rb->mp3info(&entry, selected_file);
- if(rc < 0) {
+ if(rc) {
fileerror(rc);
return true;
}
@@ -258,6 +258,8 @@ static bool vbr_fix(const char *selected_file)
}
else
{
+ rb->close(fd);
+
/* Not a VBR file */
DEBUGF("Not a VBR file\n");
rb->splash(HZ*2, ID2P(LANG_NOT_A_VBR_FILE));