summaryrefslogtreecommitdiff
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-287747591e9feafa0d5946e3f7614cec3987e2dc.tar.gz
rockbox-287747591e9feafa0d5946e3f7614cec3987e2dc.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)
150 xingupdate(0); 150 xingupdate(0);
151 151
152 rc = rb->mp3info(&entry, selected_file); 152 rc = rb->mp3info(&entry, selected_file);
153 if(rc < 0) { 153 if(rc) {
154 fileerror(rc); 154 fileerror(rc);
155 return true; 155 return true;
156 } 156 }
@@ -258,6 +258,8 @@ static bool vbr_fix(const char *selected_file)
258 } 258 }
259 else 259 else
260 { 260 {
261 rb->close(fd);
262
261 /* Not a VBR file */ 263 /* Not a VBR file */
262 DEBUGF("Not a VBR file\n"); 264 DEBUGF("Not a VBR file\n");
263 rb->splash(HZ*2, ID2P(LANG_NOT_A_VBR_FILE)); 265 rb->splash(HZ*2, ID2P(LANG_NOT_A_VBR_FILE));