From b36d3c0be228fbf7ad1b193d11d8a3365a045a43 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Tue, 15 Apr 2008 19:20:57 +0000 Subject: =?UTF-8?q?Some=20bugfixes=20after=20r17109:=20*=20Fix=20FS#8893?= =?UTF-8?q?=20by=20plugging=20a=20file=20descriptor=20leak=20in=20audio=5F?= =?UTF-8?q?load=5Ftrack.=20*=20Fix=20a=20possible=20null=20pointer=20deref?= =?UTF-8?q?erence=20by=20not=20allowing=20audio=5Fcurrent=5Ftrack=20to=20r?= =?UTF-8?q?eturn=20NULL.=20*=20Make=20audio=5Fcurrent=5Ftrack=20return=20p?= =?UTF-8?q?revtrack=5Fid3=20only=20during=20an=20automatic=20track=20skip.?= =?UTF-8?q?=20Fixes=20the=20wrong=20metadata=20being=20displayed=20for=20a?= =?UTF-8?q?=20short=20time=20after=20a=20backwards=20skip.=20-Cette=20lign?= =?UTF-8?q?e,=20et=20les=20suivantes=20ci-dessous,=20seront=20ignor=C3=A9e?= =?UTF-8?q?s--?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit M apps/playback.c git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17126 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/playback.c b/apps/playback.c index bce4b6b..38da93b 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -552,7 +552,7 @@ struct mp3entry* audio_current_track(void) /* The usual case */ return &curtrack_id3; } - else if (offset == -1 && *prevtrack_id3.path) + else if (automatic_skip && offset == -1 && *prevtrack_id3.path) { /* We're in a track transition. The codec has moved on to the nex track, but the audio being played is still the same (now previous) track. @@ -563,7 +563,8 @@ struct mp3entry* audio_current_track(void) else if (tracks[cur_idx].id3_hid >= 0) { /* Get the ID3 metadata from the main buffer */ - return bufgetid3(tracks[cur_idx].id3_hid); + struct mp3entry *ret = bufgetid3(tracks[cur_idx].id3_hid); + if (ret) return ret; } /* We didn't find the ID3 metadata, so we fill temp_id3 with the little info @@ -1648,8 +1649,6 @@ static bool audio_load_track(size_t offset, bool start_play) return false; } - close(fd); - if (track_widx == track_ridx) { buf_request_buffer_handle(tracks[track_widx].id3_hid); @@ -1664,6 +1663,7 @@ static bool audio_load_track(size_t offset, bool start_play) } } + close(fd); return true; } -- cgit v1.1