mirror of https://github.com/odrling/Aegisub
Strip Collisions lines on read
Nothing supports them and malformed values crash VSFilter. Closes #1583.
This commit is contained in:
parent
1598e81773
commit
cb9c48d6af
|
@ -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())));
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue