A few missing checks on the return value of fopen_boost.
[dcpomatic.git] / src / lib / encoded_data.cc
index 61d2644daf324dd251861dbfe686ff93e514dc31..0e8ffd6b5cc088c17fc323c6a807c338263dcc57 100644 (file)
@@ -21,6 +21,7 @@
 #include "cross.h"
 #include "exceptions.h"
 #include "film.h"
+#include "dcpomatic_socket.h"
 
 #include "i18n.h"
 
@@ -94,6 +95,9 @@ EncodedData::write_info (shared_ptr<const Film> film, int frame, Eyes eyes, dcp:
 {
        boost::filesystem::path const info = film->info_path (frame, eyes);
        FILE* h = fopen_boost (info, "w");
+       if (!h) {
+               throw OpenFileError (info);
+       }
        fin.write (h);
        fclose (h);
 }