Fix a few warnings.
authorCarl Hetherington <cth@carlh.net>
Thu, 18 Jul 2013 17:58:49 +0000 (18:58 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 18 Jul 2013 17:58:49 +0000 (18:58 +0100)
src/lib/writer.cc
src/tools/dcpomatic.cc

index 6601fb2fe69631ebbc2228f2ad7d1d51987bec11..a9c920c8122340a3ce2e1296861b16ead84f0670 100644 (file)
@@ -358,15 +358,19 @@ Writer::check_existing_picture_mxf ()
                /* Read the data from the MXF and hash it */
                fseek (mxf, info.offset, SEEK_SET);
                EncodedData data (info.size);
-               fread (data.data(), 1, data.size(), mxf);
-               string const existing_hash = md5_digest (data.data(), data.size());
+               size_t const read = fread (data.data(), 1, data.size(), mxf);
+               if (read != static_cast<size_t> (data.size ())) {
+                       _film->log()->log (String::compose ("Existing frame %1 is incomplete", _first_nonexistant_frame));
+                       break;
+               }
                
+               string const existing_hash = md5_digest (data.data(), data.size());
                if (existing_hash != info.hash) {
-                       _film->log()->log (String::compose (N_("Existing frame %1 failed hash check"), _first_nonexistant_frame));
+                       _film->log()->log (String::compose ("Existing frame %1 failed hash check", _first_nonexistant_frame));
                        break;
                }
 
-               _film->log()->log (String::compose (N_("Have existing frame %1"), _first_nonexistant_frame));
+               _film->log()->log (String::compose ("Have existing frame %1", _first_nonexistant_frame));
                ++_first_nonexistant_frame;
        }
 
index f016cf3e4ceada4e818ba527e241506cccdfb1c3..afde7e6c5eb5b0df74d12634728f31773cede09c 100644 (file)
@@ -394,11 +394,17 @@ private:
 #else
                int r = system ("which nautilus");
                if (WEXITSTATUS (r) == 0) {
-                       system (string ("nautilus " + film->directory()).c_str ());
+                       r = system (string ("nautilus " + film->directory()).c_str ());
+                       if (WEXITSTATUS (r)) {
+                               error_dialog (this, _("Could not show DCP (could not run nautilus)"));
+                       }
                } else {
                        int r = system ("which konqueror");
                        if (WEXITSTATUS (r) == 0) {
-                               system (string ("konqueror " + film->directory()).c_str ());
+                               r = system (string ("konqueror " + film->directory()).c_str ());
+                               if (WEXITSTATUS (r)) {
+                                       error_dialog (this, _("Could not show DCP (could not run konqueror)"));
+                               }
                        }
                }
 #endif