From cb9c48d6af5d1fac5dda19382e508dd782020f4b Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 30 Mar 2013 07:18:34 -0700 Subject: [PATCH] Strip Collisions lines on read Nothing supports them and malformed values crash VSFilter. Closes #1583. --- aegisub/src/ass_file.cpp | 1 - aegisub/src/ass_parser.cpp | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/aegisub/src/ass_file.cpp b/aegisub/src/ass_file.cpp index 44bb73544..69c9e92ca 100644 --- a/aegisub/src/ass_file.cpp +++ b/aegisub/src/ass_file.cpp @@ -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()))); diff --git a/aegisub/src/ass_parser.cpp b/aegisub/src/ass_parser.cpp index 511e318fe..2917785c8 100644 --- a/aegisub/src/ass_parser.cpp +++ b/aegisub/src/ass_parser.cpp @@ -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;