diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-12-13 21:22:15 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-01-17 20:13:22 +0100 |
| commit | 5382d3e0e587b1882ea39be146bbd9dd5700c3bb (patch) | |
| tree | 1919f532e8dd0d322f7406a39892b45e54b019e4 /src | |
| parent | ea454d8c6eabe0dfa3e82b36e5813012cf93395c (diff) | |
Raise an exception to head off a weird asdcplib error with empty JPEG2000 comments.
Diffstat (limited to 'src')
| -rw-r--r-- | src/j2k.cc | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 */ |
