summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/picture_asset_writer.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/picture_asset_writer.cc b/src/picture_asset_writer.cc
index 8ac76c9c..1789562f 100644
--- a/src/picture_asset_writer.cc
+++ b/src/picture_asset_writer.cc
@@ -30,8 +30,19 @@ using boost::shared_ptr;
using namespace libdcp;
FrameInfo::FrameInfo (istream& s)
+ : offset (0)
+ , size (0)
{
- s >> offset >> size >> hash;
+ s >> offset >> size;
+
+ if (!s.good ()) {
+ /* Make sure we zero these if something bad happened, otherwise
+ the caller might try to alloc lots of RAM.
+ */
+ offset = size = 0;
+ }
+
+ s >> hash;
}
void