From 94b9c9d8b18b077099e1fee5235ef04191ce9b7a Mon Sep 17 00:00:00 2001 From: learman Date: Tue, 1 Feb 2011 20:17:42 +0000 Subject: [PATCH] Add a safety check in the resume seek code, just in case. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29181 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libm4a/m4a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/codecs/libm4a/m4a.c b/apps/codecs/libm4a/m4a.c index 7ff9dd254..8c4b172bc 100644 --- a/apps/codecs/libm4a/m4a.c +++ b/apps/codecs/libm4a/m4a.c @@ -362,7 +362,7 @@ unsigned int alac_seek_raw(demux_res_t* demux_res, stream_t* stream, } ++chunk; } - new_pos = demux_res->chunk_offset[chunk-1]; + new_pos = demux_res->chunk_offset[chunk > 0 ? chunk - 1 : 0]; /* Get the first sample of the chunk. */ i = 1; -- 2.11.4.GIT