projects
/
libdcp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d44777
)
Try to be more careful when loading FrameInfos from disk.
author
Carl Hetherington
<cth@carlh.net>
Thu, 25 Jul 2013 15:19:21 +0000
(16:19 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Thu, 25 Jul 2013 15:19:21 +0000
(16:19 +0100)
src/picture_asset_writer.cc
patch
|
blob
|
history
diff --git
a/src/picture_asset_writer.cc
b/src/picture_asset_writer.cc
index 8ac76c9c522096a4aef61f63a1410ca059f8f4eb..1789562f6edf232169f21965f629b39a775118fe 100644
(file)
--- 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