projects
/
libdcp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ea454d8
)
Raise an exception to head off a weird asdcplib error with empty JPEG2000 comments.
author
Carl Hetherington
<cth@carlh.net>
Sun, 13 Dec 2020 20:22:15 +0000
(21:22 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Sun, 17 Jan 2021 19:13:22 +0000
(20:13 +0100)
src/j2k.cc
patch
|
blob
|
history
diff --git
a/src/j2k.cc
b/src/j2k.cc
index 032c7caa73a832bf09f4408a302598c8a2bf792c..654146ca848845e3cc735fa517ad247189688385 100644
(file)
--- a/
src/j2k.cc
+++ b/
src/j2k.cc
@@
-283,6
+283,11
@@
dcp::compress_j2k (shared_ptr<const OpenJPEGImage> xyz, int bandwidth, int frame
throw MiscError ("could not create JPEG2000 encoder");
}
+ if (comment.empty()) {
+ /* asdcplib complains with "Illegal data size" when reading frames encoded with an empty comment */
+ throw MiscError("compress_j2k comment can not be an empty string");
+ }
+
opj_set_error_handler (encoder, compress_error_callback, 0);
/* Set encoding parameters to default values */