From 659fe5a35bad0483f67f52ba032b02de98d49407 Mon Sep 17 00:00:00 2001 From: Nicolas Pennequin Date: Tue, 8 Jan 2008 23:48:51 +0000 Subject: Fix FS#6215 (player crashes after trying to resume deleted music file). As mentioned in the lastest comment, the problem was in trying to resume at an offset larger than the size of the file following the one that was deleted. This revealed a crash in the buffering code, which gets a fix, but we also need to intervene earlier in the track loading so that the track that gets played will be from its start. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16028 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apps/playback.c') diff --git a/apps/playback.c b/apps/playback.c index 1e5cd626de..ed581cd36a 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -1683,6 +1683,9 @@ static bool audio_load_track(int offset, bool start_play) tracks[track_widx].filesize = filesize(fd); + if ((unsigned)offset > tracks[track_widx].filesize) + offset = 0; + /* Set default values */ if (start_play) { -- cgit v1.2.3