summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/j2k.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/j2k.cc b/src/j2k.cc
index 032c7caa..654146ca 100644
--- 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 */