projects
/
libdcp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85bd14f
)
Check return value of fread().
author
Carl Hetherington
<cth@carlh.net>
Sun, 8 Jul 2018 23:42:15 +0000
(
00:42
+0100)
committer
Carl Hetherington
<cth@carlh.net>
Sun, 8 Jul 2018 23:42:15 +0000
(
00:42
+0100)
src/mono_picture_frame.cc
patch
|
blob
|
history
diff --git
a/src/mono_picture_frame.cc
b/src/mono_picture_frame.cc
index 7ac807cba27029c013ca0d00e864e1172a80dc02..9af34c486fda5ffe0d41dd0adef825ebde2c68a6 100644
(file)
--- a/
src/mono_picture_frame.cc
+++ b/
src/mono_picture_frame.cc
@@
-63,7
+63,11
@@
MonoPictureFrame::MonoPictureFrame (boost::filesystem::path path)
boost::throw_exception (FileError ("could not open JPEG2000 file", path, errno));
}
- fread (j2k_data(), 1, size, f);
+ size_t n = fread (j2k_data(), 1, size, f);
+ if (n != size) {
+ boost::throw_exception (FileError ("could not read from JPEG2000 file", path, errno));
+ }
+
fclose (f);
_buffer->Size (size);