Browse Source

Potentially fixed a bug in the vorbis decoder seek callback.

Alex Szpakowski 10 years ago
parent
commit
91e94b4662
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/modules/sound/lullaby/VorbisDecoder.cpp

+ 4 - 2
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;
 		vorbisData->dataRead += (int)actualOffset;
 		break;
 		break;
 	case SEEK_END: // Seek from the end of the file
 	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;
 		break;
 	default:
 	default:
-		throw love::Exception("Unknown seek command in vorbisSeek");
 		break;
 		break;
 	};
 	};