Fix potential crash if maybe_add_text() fails.
[dcpomatic.git] / src / lib / subtitle_analysis.cc
index f8254f00d62fa791742d097812445801e727a7d6..28eedac0d84d7fba2a780a20e69f282bf292dd8c 100644 (file)
 
 #include "subtitle_analysis.h"
 #include "exceptions.h"
+#include "warnings.h"
 #include <libcxml/cxml.h>
 #include <dcp/raw_convert.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 using std::string;
 using dcp::raw_convert;
@@ -39,7 +42,7 @@ SubtitleAnalysis::SubtitleAnalysis (boost::filesystem::path path)
 
        if (f.optional_number_child<int>("Version").get_value_or(1) < _current_state_version) {
                /* Too old.  Throw an exception so that this analysis is re-run. */
-               throw OldFormatError ("Audio analysis file is too old");
+               throw OldFormatError ("Subtitle analysis file is too old");
        }
 
        cxml::NodePtr bounding_box = f.optional_node_child("BoundingBox");