Strip Collisions lines on read

Nothing supports them and malformed values crash VSFilter.

Closes #1583.
This commit is contained in:
Thomas Goyne 2013-03-30 07:18:34 -07:00
parent 1598e81773
commit cb9c48d6af
2 changed files with 5 additions and 1 deletions

View file

@ -67,7 +67,6 @@ void AssFile::LoadDefault(bool defline) {
Line.push_back(*new AssInfo("ScriptType", "v4.00+"));
Line.push_back(*new AssInfo("WrapStyle", "0"));
Line.push_back(*new AssInfo("ScaledBorderAndShadow", "yes"));
Line.push_back(*new AssInfo("Collisions", "Normal"));
if (!OPT_GET("Subtitle/Default Resolution/Auto")->GetBool()) {
Line.push_back(*new AssInfo("PlayResX", std::to_string(OPT_GET("Subtitle/Default Resolution/Width")->GetInt())));
Line.push_back(*new AssInfo("PlayResY", std::to_string(OPT_GET("Subtitle/Default Resolution/Height")->GetInt())));

View file

@ -84,6 +84,11 @@ void AssParser::ParseScriptInfoLine(std::string const& data) {
throw SubtitleFormatParseError("Unknown SSA file format version", 0);
}
// Nothing actually supports the Collisions property and malformed values
// crash VSFilter, so just remove it entirely
if (boost::starts_with(data, "Collisions:"))
return;
size_t pos = data.find(':');
if (pos == data.npos) return;