diff options
| author | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2007-01-03 15:41:50 +0000 |
|---|---|---|
| committer | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2007-01-03 15:41:50 +0000 |
| commit | ef560f19a31610f6ca3dedbe22ff26dcbbe57c1b (patch) | |
| tree | 4295dbea768df391626011d38ff81230a872ffae /libopenjpeg | |
| parent | 6b9d244449340035f7235132ec34a877c936dd53 (diff) | |
JP2 module: Tests during encoding if the number of components respects the JPEG 2000 standard.
Diffstat (limited to 'libopenjpeg')
| -rw-r--r-- | libopenjpeg/jp2.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libopenjpeg/jp2.c b/libopenjpeg/jp2.c index c411f7e0..b34a36d7 100644 --- a/libopenjpeg/jp2.c +++ b/libopenjpeg/jp2.c @@ -619,6 +619,12 @@ void jp2_setup_encoder(opj_jp2_t *jp2, opj_cparameters_t *parameters, opj_image_ /* setup the J2K codec */ /* ------------------- */ + /* Check if number of components respects standard */ + if (image->numcomps < 1 || image->numcomps > 16384) { + opj_event_msg(jp2->cinfo, EVT_ERROR, "Invalid number of components specified while setting up JP2 encoder\n"); + return; + } + j2k_setup_encoder(jp2->j2k, parameters, image); /* setup the JP2 codec */ |
