Skip to content

Commit

Permalink
Limit loop marker search to first 16KiB
Browse files Browse the repository at this point in the history
  • Loading branch information
derselbst committed Jan 3, 2020
1 parent 21e6e49 commit 9d33cbc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/InputLibraryWrapper/LibSNDWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ LibSNDWrapper::LibSNDWrapper(string filename, Nullable<size_t> offset, Nullable<
void LibSNDWrapper::init()
{
std::ifstream ifs(this->Filename, ios::binary);
std::string str((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
std::array<char, 1<<14> buf;
ifs.read(buf.data(), sizeof(buf));
std::string str(buf.data(), ifs.gcount());
std::regex rxStart("LOOPSTART=([0-9]+)");
std::regex rxLen("LOOPLENGTH=([0-9]+)");

Expand Down

0 comments on commit 9d33cbc

Please sign in to comment.