Fix crash on failing to open a frame info file.
authorCarl Hetherington <cth@carlh.net>
Mon, 2 Dec 2013 09:19:12 +0000 (09:19 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 2 Dec 2013 09:19:12 +0000 (09:19 +0000)
ChangeLog
src/lib/writer.cc

index c579b68044b7734a937b5797e863864fda222962..51e56cbce932f3cd9f865d0a7507a40f1e3737d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2013-12-02  Carl Hetherington  <cth@carlh.net>
 
+       * Fix crash on checking non-existing frame info
+       files.
+
        * Fix erroneous disabling of timing panel with
        audio-only sources.
 
index f4128e6c573d6b65e81480b699fdb8626e595ee0..60b2a47ab13b265fe1f5ca288ef576912db0ea12 100644 (file)
@@ -432,6 +432,11 @@ Writer::check_existing_picture_mxf_frame (FILE* mxf, int f, Eyes eyes)
 {
        /* Read the frame info as written */
        FILE* ifi = fopen_boost (_film->info_path (f, eyes), "r");
+       if (!ifi) {
+               _film->log()->log (String::compose ("Existing frame %1 has no info file", f));
+               return false;
+       }
+       
        libdcp::FrameInfo info (ifi);
        fclose (ifi);
        if (info.size == 0) {