From 11b7a4fb26ac65b196b9f3c23315f9cf5cb696b5 Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Tue, 1 Feb 2011 20:17:42 +0000 Subject: 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(-) (limited to 'apps/codecs') diff --git a/apps/codecs/libm4a/m4a.c b/apps/codecs/libm4a/m4a.c index 7ff9dd2544..8c4b172bc2 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; -- cgit v1.2.3