summaryrefslogtreecommitdiff
path: root/apps/metadata.c
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2006-05-20 14:30:32 +0000
committerMagnus Holmgren <magnushol@gmail.com>2006-05-20 14:30:32 +0000
commit6ddb5f24294d68749e53c10a99ca09aca9f9f7eb (patch)
treef3112b833921526d6fcde2b00691edb9314910bb /apps/metadata.c
parentfd18a4e9d38a478dcefea6842ec9352ee7273c89 (diff)
Fix bug 4916: Short Vorbis files won't play.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9969 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/metadata.c')
-rw-r--r--apps/metadata.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/metadata.c b/apps/metadata.c
index 797192080f..9cb055608a 100644
--- a/apps/metadata.c
+++ b/apps/metadata.c
@@ -643,7 +643,8 @@ static bool get_vorbis_metadata(int fd, struct mp3entry* id3)
* by ('O','g','g','S',0) and retrieve totalsamples.
*/
- if (lseek(fd, -64 * 1024, SEEK_END) < 0) /* A page is always < 64 kB */
+ /* A page is always < 64 kB */
+ if (lseek(fd, -(MIN(64 * 1024, id3->filesize)), SEEK_END) < 0)
{
return false;
}