X-Git-Url: https://git.octo.it/?p=supertux.git;a=blobdiff_plain;f=src%2Faudio%2Fsound_file.cpp;h=834aedaf47f8d073268b77e564c4204e14533333;hp=ebe7ea3e12af9e6bd5dbafdbe4e8ef8f284a3ec1;hb=0ebb40343bafd9f8b047c1917c91ab3611ded965;hpb=1b11867e0ee5c2d9acbe0bb73c9bcd5b10701e52 diff --git a/src/audio/sound_file.cpp b/src/audio/sound_file.cpp index ebe7ea3e1..834aedaf4 100644 --- a/src/audio/sound_file.cpp +++ b/src/audio/sound_file.cpp @@ -83,7 +83,12 @@ std::unique_ptr load_sound_file(const std::string& filename) char magic[4]; if(PHYSFS_read(file, magic, sizeof(magic), 1) != 1) throw SoundError("Couldn't read magic, file too short"); - PHYSFS_seek(file, 0); + if (PHYSFS_seek(file, 0) == 0) { + std::stringstream msg; + msg << "Couldn't seek through sound file: " << PHYSFS_getLastError(); + throw SoundError(msg.str()); + } + if(strncmp(magic, "RIFF", 4) == 0) return std::unique_ptr(new WavSoundFile(file)); else if(strncmp(magic, "OggS", 4) == 0)