From 91e94b46626f38803e21373306bc30da5e78d497 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Fri, 3 Jul 2015 16:50:58 -0300 Subject: [PATCH] Potentially fixed a bug in the vorbis decoder seek callback. --- src/modules/sound/lullaby/VorbisDecoder.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/sound/lullaby/VorbisDecoder.cpp b/src/modules/sound/lullaby/VorbisDecoder.cpp index 7cff4aabb..4c2ee13cf 100644 --- a/src/modules/sound/lullaby/VorbisDecoder.cpp +++ b/src/modules/sound/lullaby/VorbisDecoder.cpp @@ -106,10 +106,12 @@ static int vorbisSeek(void *datasource /* ptr to the data that the vorbis files vorbisData->dataRead += (int)actualOffset; break; case SEEK_END: // Seek from the end of the file - vorbisData->dataRead = vorbisData->dataSize+1; + if (offset < 0) + vorbisData->dataRead = vorbisData->dataSize + offset; + else + vorbisData->dataRead = vorbisData->dataSize; break; default: - throw love::Exception("Unknown seek command in vorbisSeek"); break; };