Skip to content

Commit

Permalink
oob
Browse files Browse the repository at this point in the history
  • Loading branch information
appgurueu committed Jan 10, 2025
1 parent 8b067fa commit 2ca2552
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client/fontengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ void FontEngine::setMediaFont(const std::string &name, const std::string &data)
}

constexpr char TTF_MAGIC[5] = {0, 1, 0, 0, 0};
if (memcmp(data.data(), "wOF2", 4) && memcmp(data.data(), TTF_MAGIC, 5)) {
if (data.size() < 5 || (memcmp(data.data(), "wOF2", 4) &&
memcmp(data.data(), TTF_MAGIC, 5))) {
warningstream << "Rejecting media font with unrecognized magic" << std::endl;
return;
}
Expand Down

0 comments on commit 2ca2552

Please sign in to comment.