summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-18 18:58:49 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-18 18:58:49 +0100
commit308cf01bf7ba51af4b09a06d8483c78a1eecb7f6 (patch)
tree4a18545b38917c2853ce3251c60d0a1aa88fcf32 /src/lib
parent0b1f3a5dc3069726e61670b1aa35e62ba96ed198 (diff)
Fix a few warnings.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/writer.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index 6601fb2fe..a9c920c81 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -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;
}