summaryrefslogtreecommitdiff
path: root/libopenjpeg
diff options
context:
space:
mode:
authorGiuseppe Baruffa <gbaruffa@users.noreply.github.com>2007-09-03 13:30:59 +0000
committerGiuseppe Baruffa <gbaruffa@users.noreply.github.com>2007-09-03 13:30:59 +0000
commit564e16d5cea51dc877870055e2703330ad323cdd (patch)
tree55d241a023631ee09e4ae754bfde733f38018aba /libopenjpeg
parentc4313f0b3983381332546bdae10ecab2dffdd794 (diff)
Added the knowledge of JPSEC SEC and INSEC markers (you have to compile the JPWL project). Management of these markers is limited to skipping them without crashing: no real security function at this stage. Deprecated USE_JPSEC and USE_JPWL will be removed next
Diffstat (limited to 'libopenjpeg')
-rw-r--r--libopenjpeg/j2k.c7
-rw-r--r--libopenjpeg/j2k.h13
2 files changed, 16 insertions, 4 deletions
diff --git a/libopenjpeg/j2k.c b/libopenjpeg/j2k.c
index f020167c..476b68c5 100644
--- a/libopenjpeg/j2k.c
+++ b/libopenjpeg/j2k.c
@@ -1541,6 +1541,10 @@ opj_dec_mstabent_t j2k_dec_mstab[] = {
{J2K_MS_ESD, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_esd},
{J2K_MS_RED, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_red},
#endif /* USE_JPWL */
+#ifdef USE_JPSEC
+ {J2K_MS_SEC, J2K_STATE_MH, j2k_read_sec},
+ {J2K_MS_INSEC, 0, j2k_read_insec},
+#endif /* USE_JPSEC */
{0, J2K_STATE_MH | J2K_STATE_TPH, j2k_read_unk}
};
@@ -2261,6 +2265,9 @@ bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_codestre
}
}
+ /* uncomment only for testing JPSEC marker writing */
+ /* j2k_write_sec(j2k); */
+
/* INDEX >> */
if(cstr_info && cstr_info->index_on) {
cstr_info->main_head_end = cio_tell(cio) - 1;
diff --git a/libopenjpeg/j2k.h b/libopenjpeg/j2k.h
index 8ed758c2..fa63b7fa 100644
--- a/libopenjpeg/j2k.h
+++ b/libopenjpeg/j2k.h
@@ -79,13 +79,18 @@ The functions in J2K.C have for goal to read/write the several parts of the code
#define J2K_MS_COM 0xff64 /**< COM marker value */
/* UniPG>> */
#ifdef USE_JPWL
-#define J2K_MS_EPC 0xff68 /**< EPC marker value (Part11) */
-#define J2K_MS_EPB 0xff66 /**< EPB marker value (Part11) */
-#define J2K_MS_ESD 0xff67 /**< ESD marker value (Part11) */
-#define J2K_MS_RED 0xff69 /**< RED marker value (Part11) */
+#define J2K_MS_EPC 0xff68 /**< EPC marker value (Part 11: JPEG 2000 for Wireless) */
+#define J2K_MS_EPB 0xff66 /**< EPB marker value (Part 11: JPEG 2000 for Wireless) */
+#define J2K_MS_ESD 0xff67 /**< ESD marker value (Part 11: JPEG 2000 for Wireless) */
+#define J2K_MS_RED 0xff69 /**< RED marker value (Part 11: JPEG 2000 for Wireless) */
#endif /* USE_JPWL */
+#ifdef USE_JPSEC
+#define J2K_MS_SEC 0xff65 /**< SEC marker value (Part 8: Secure JPEG 2000) */
+#define J2K_MS_INSEC 0xff94 /**< INSEC marker value (Part 8: Secure JPEG 2000) */
+#endif /* USE_JPSEC */
/* <<UniPG */
+
/* ----------------------------------------------------------------------- */
/**