summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2024-02-28 16:49:26 +0100
committerGitHub <noreply@github.com>2024-02-28 16:49:26 +0100
commit1b72e85dc9a2b55c9142a74fb5b93338d59f92f0 (patch)
treeaeeef83ddd4d13eb8d7fffb693bcb0912b9dc0e3
parent7a2773d3bab5c078d19edc7326957e95202a593c (diff)
parent20ad29f497cf1afacb243c0019069ba10a0320bd (diff)
Merge pull request #1517 from stweil/typos
Fix some typos (found by `codespell` and `typos`)
-rw-r--r--doc/man/man3/libopenjp2.34
-rw-r--r--src/bin/jp2/convertbmp.c4
-rw-r--r--src/bin/jp2/opj_compress.c2
-rw-r--r--src/bin/wx/OPJViewer/source/imagjpeg2000.cpp2
-rw-r--r--src/bin/wx/OPJViewer/source/wxj2kparser.cpp4
-rw-r--r--src/lib/openjp2/ht_dec.c6
-rw-r--r--src/lib/openjp2/openjpeg.h2
-rw-r--r--src/lib/openjp2/opj_common.h6
-rw-r--r--src/lib/openjp2/t1.c2
-rw-r--r--src/lib/openjp2/tcd.c6
-rw-r--r--src/lib/openjp2/tcd.h6
-rw-r--r--src/lib/openjpip/auxtrans_manager.h4
-rw-r--r--src/lib/openjpip/box_manager.h4
-rw-r--r--src/lib/openjpip/boxheader_manager.h2
-rw-r--r--src/lib/openjpip/byte_manager.h12
-rw-r--r--src/lib/openjpip/msgqueue_manager.h2
-rw-r--r--src/lib/openjpip/openjpip.h2
-rw-r--r--src/lib/openjpip/session_manager.h2
-rw-r--r--src/lib/openjpip/sock_manager.h4
-rw-r--r--tests/compare_images.c2
-rw-r--r--tests/nonregression/CMakeLists.txt4
-rw-r--r--tests/nonregression/test_suite.ctest.in2
-rw-r--r--tests/pdf2jp2.c8
-rw-r--r--wrapping/java/openjp2/JavaOpenJPEG.c4
24 files changed, 48 insertions, 48 deletions
diff --git a/doc/man/man3/libopenjp2.3 b/doc/man/man3/libopenjp2.3
index 9b06cc86..f504621d 100644
--- a/doc/man/man3/libopenjp2.3
+++ b/doc/man/man3/libopenjp2.3
@@ -245,10 +245,10 @@ typedef struct opj_cparameters
\fBchar\fR infile[OPJ_PATH_LEN];
/* output file name */
\fBchar\fR outfile[OPJ_PATH_LEN];
- /* DEPRECATED. Index generation is now handeld with the
+ /* DEPRECATED. Index generation is now handled with the
opj_encode_with_info() function. Set to NULL */
\fBint\fR index_on;
- /* DEPRECATED. Index generation is now handeld with the
+ /* DEPRECATED. Index generation is now handled with the
opj_encode_with_info() function. Set to NULL */
\fBchar\fR index[OPJ_PATH_LEN];
/* subimage encoding: origin image offset in x direction */
diff --git a/src/bin/jp2/convertbmp.c b/src/bin/jp2/convertbmp.c
index eb4d420c..3ef9915f 100644
--- a/src/bin/jp2/convertbmp.c
+++ b/src/bin/jp2/convertbmp.c
@@ -604,7 +604,7 @@ static OPJ_BOOL bmp_read_rle8_data(FILE* IN, OPJ_UINT8* pData,
}/* while() */
if (written != width * height) {
- fprintf(stderr, "warning, image's actual size does not match advertized one\n");
+ fprintf(stderr, "warning, image's actual size does not match advertised one\n");
return OPJ_FALSE;
}
@@ -693,7 +693,7 @@ static OPJ_BOOL bmp_read_rle4_data(FILE* IN, OPJ_UINT8* pData,
}
} /* while(y < height) */
if (written != width * height) {
- fprintf(stderr, "warning, image's actual size does not match advertized one\n");
+ fprintf(stderr, "warning, image's actual size does not match advertised one\n");
return OPJ_FALSE;
}
return OPJ_TRUE;
diff --git a/src/bin/jp2/opj_compress.c b/src/bin/jp2/opj_compress.c
index 212f144e..c3d7f4fb 100644
--- a/src/bin/jp2/opj_compress.c
+++ b/src/bin/jp2/opj_compress.c
@@ -728,7 +728,7 @@ static int parse_cmdline_encoder(int argc, char **argv,
/* ----------------------------------------------------- */
- case 'r': { /* rates rates/distorsion */
+ case 'r': { /* rates rates/distortion */
char *s = opj_optarg;
parameters->tcp_numlayers = 0;
while (sscanf(s, "%f", &parameters->tcp_rates[parameters->tcp_numlayers]) ==
diff --git a/src/bin/wx/OPJViewer/source/imagjpeg2000.cpp b/src/bin/wx/OPJViewer/source/imagjpeg2000.cpp
index 9e1ab90d..4eda46ad 100644
--- a/src/bin/wx/OPJViewer/source/imagjpeg2000.cpp
+++ b/src/bin/wx/OPJViewer/source/imagjpeg2000.cpp
@@ -652,7 +652,7 @@ jpeg2000_file_parse(wxInputStream& stream, unsigned long int filepoint,
return (0);
}
-// search first contiguos codestream box in an mj2 file
+// search first contiguous codestream box in an mj2 file
unsigned long int
searchjpeg2000c(wxInputStream& stream, unsigned long int fsize, int number)
{
diff --git a/src/bin/wx/OPJViewer/source/wxj2kparser.cpp b/src/bin/wx/OPJViewer/source/wxj2kparser.cpp
index 7c85d873..1ff7d6b4 100644
--- a/src/bin/wx/OPJViewer/source/wxj2kparser.cpp
+++ b/src/bin/wx/OPJViewer/source/wxj2kparser.cpp
@@ -845,7 +845,7 @@ void OPJParseThread::ParseJ2KFile(wxFile *m_file, wxFileOffset offset, wxFileOff
);
if (cbstyle & 0x04)
- text = wxT("Termination on each coding passs");
+ text = wxT("Termination on each coding pass");
else
text = wxT("No termination on each coding pass");
subcurrid4 = m_tree->AppendItem(subcurrid3,
@@ -1064,7 +1064,7 @@ void OPJParseThread::ParseJ2KFile(wxFile *m_file, wxFileOffset offset, wxFileOff
);
if (cbstyle & 0x04)
- text = wxT("Termination on each coding passs");
+ text = wxT("Termination on each coding pass");
else
text = wxT("No termination on each coding pass");
subcurrid4 = m_tree->AppendItem(subcurrid3,
diff --git a/src/lib/openjp2/ht_dec.c b/src/lib/openjp2/ht_dec.c
index a554b24a..2984f560 100644
--- a/src/lib/openjp2/ht_dec.c
+++ b/src/lib/openjp2/ht_dec.c
@@ -901,7 +901,7 @@ typedef struct frwd_struct {
* X controls this value.
*
* Unstuffing prevent sequences that are more than 0xFF7F from appearing
- * in the conpressed sequence. So whenever a value of 0xFF is coded, the
+ * in the compressed sequence. So whenever a value of 0xFF is coded, the
* MSB of the next byte is set 0 and must be ignored during decoding.
*
* Reading can go beyond the end of buffer by up to 3 bytes.
@@ -1032,7 +1032,7 @@ OPJ_UINT32 frwd_fetch(frwd_struct_t *msp)
//************************************************************************/
/** @brief Allocates T1 buffers
*
- * @param [in, out] t1 is codeblock cofficients storage
+ * @param [in, out] t1 is codeblock coefficients storage
* @param [in] w is codeblock width
* @param [in] h is codeblock height
*/
@@ -1120,7 +1120,7 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
/** @brief Decodes one codeblock, processing the cleanup, siginificance
* propagation, and magnitude refinement pass
*
- * @param [in, out] t1 is codeblock cofficients storage
+ * @param [in, out] t1 is codeblock coefficients storage
* @param [in] cblk is codeblock properties
* @param [in] orient is the subband to which the codeblock belongs (not needed)
* @param [in] roishift is region of interest shift
diff --git a/src/lib/openjp2/openjpeg.h b/src/lib/openjp2/openjpeg.h
index 67d168bb..113481bb 100644
--- a/src/lib/openjp2/openjpeg.h
+++ b/src/lib/openjp2/openjpeg.h
@@ -772,7 +772,7 @@ typedef struct opj_packet_info {
OPJ_OFF_T end_ph_pos;
/** packet end position */
OPJ_OFF_T end_pos;
- /** packet distorsion */
+ /** packet distortion */
double disto;
} opj_packet_info_t;
diff --git a/src/lib/openjp2/opj_common.h b/src/lib/openjp2/opj_common.h
index ee8adf47..2923a35b 100644
--- a/src/lib/openjp2/opj_common.h
+++ b/src/lib/openjp2/opj_common.h
@@ -28,8 +28,8 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef OPJ_COMMMON_H
-#define OPJ_COMMMON_H
+#ifndef OPJ_COMMON_H
+#define OPJ_COMMON_H
/*
==========================================================
@@ -44,4 +44,4 @@
#define OPJ_COMP_PARAM_DEFAULT_PROG_ORDER OPJ_LRCP
#define OPJ_COMP_PARAM_DEFAULT_NUMRESOLUTION 6
-#endif /* OPJ_COMMMON_H */
+#endif /* OPJ_COMMON_H */
diff --git a/src/lib/openjp2/t1.c b/src/lib/openjp2/t1.c
index 52e466eb..df14ffc1 100644
--- a/src/lib/openjp2/t1.c
+++ b/src/lib/openjp2/t1.c
@@ -2124,7 +2124,7 @@ static OPJ_BOOL opj_t1_decode_cblk(opj_t1_t *t1,
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_WARNING,
- "PTERM check failure: %d synthetized 0xFF markers read\n",
+ "PTERM check failure: %d synthesized 0xFF markers read\n",
mqc->end_of_byte_stream_counter);
if (p_manager_mutex) {
opj_mutex_unlock(p_manager_mutex);
diff --git a/src/lib/openjp2/tcd.c b/src/lib/openjp2/tcd.c
index 687aa61b..8ca259b7 100644
--- a/src/lib/openjp2/tcd.c
+++ b/src/lib/openjp2/tcd.c
@@ -243,7 +243,7 @@ void opj_tcd_rateallocate_fixed(opj_tcd_t *tcd)
/* ----------------------------------------------------------------------- */
/** Returns OPJ_TRUE if the layer allocation is unchanged w.r.t to the previous
- * invokation with a different threshold */
+ * invocation with a different threshold */
static
OPJ_BOOL opj_tcd_makelayer(opj_tcd_t *tcd,
OPJ_UINT32 layno,
@@ -2861,12 +2861,12 @@ OPJ_BOOL opj_tcd_is_subband_area_of_interest(opj_tcd_t *tcd,
return intersects;
}
-/** Returns whether a tile componenent is fully decoded, taking into account
+/** Returns whether a tile component is fully decoded, taking into account
* p_tcd->win_* members.
*
* @param p_tcd TCD handle.
* @param compno Component number
- * @return OPJ_TRUE whether the tile componenent is fully decoded
+ * @return OPJ_TRUE whether the tile component is fully decoded
*/
static OPJ_BOOL opj_tcd_is_whole_tilecomp_decoding(opj_tcd_t *p_tcd,
OPJ_UINT32 compno)
diff --git a/src/lib/openjp2/tcd.h b/src/lib/openjp2/tcd.h
index f659869a..cf4e0082 100644
--- a/src/lib/openjp2/tcd.h
+++ b/src/lib/openjp2/tcd.h
@@ -312,7 +312,7 @@ typedef struct opj_tcd_marker_info {
/**
Dump the content of a tcd structure
*/
-/*void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t *img);*/ /* TODO MSD shoul use the new v2 structures */
+/*void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t *img);*/ /* TODO MSD should use the new v2 structures */
/**
Create a new TCD handle
@@ -443,7 +443,7 @@ OPJ_BOOL opj_tcd_update_tile_data(opj_tcd_t *p_tcd,
OPJ_SIZE_T opj_tcd_get_encoder_input_buffer_size(opj_tcd_t *p_tcd);
/**
- * Initialize the tile coder and may reuse some meory.
+ * Initialize the tile coder and may reuse some memory.
*
* @param p_tcd TCD handle.
* @param p_tile_no current tile index to encode.
@@ -491,7 +491,7 @@ void opj_tcd_reinit_segment(opj_tcd_seg_t* seg);
* @param y0 Upper left y in subband coordinates
* @param x1 Lower right x in subband coordinates
* @param y1 Lower right y in subband coordinates
- * @return OPJ_TRUE whether the sub-band region contributs to the area of
+ * @return OPJ_TRUE whether the sub-band region contributes to the area of
* interest.
*/
OPJ_BOOL opj_tcd_is_subband_area_of_interest(opj_tcd_t *tcd,
diff --git a/src/lib/openjpip/auxtrans_manager.h b/src/lib/openjpip/auxtrans_manager.h
index 7a453170..e7527275 100644
--- a/src/lib/openjpip/auxtrans_manager.h
+++ b/src/lib/openjpip/auxtrans_manager.h
@@ -38,8 +38,8 @@
typedef struct auxtrans_param {
int tcpauxport; /**< tcp port*/
int udpauxport; /**< udp port*/
- SOCKET tcplistensock; /**< listenning socket for aux tcp (-1 if not open)*/
- SOCKET udplistensock; /**< listenning socket for aux udp (-1 if not open)*/
+ SOCKET tcplistensock; /**< listening socket for aux tcp (-1 if not open)*/
+ SOCKET udplistensock; /**< listening socket for aux udp (-1 if not open)*/
} auxtrans_param_t;
/**
diff --git a/src/lib/openjpip/box_manager.h b/src/lib/openjpip/box_manager.h
index 250ef640..4a3ae767 100644
--- a/src/lib/openjpip/box_manager.h
+++ b/src/lib/openjpip/box_manager.h
@@ -72,7 +72,7 @@ boxlist_param_t * get_boxstructure(int fd, OPJ_OFF_T offset, OPJ_SIZE_T length);
/**
* generate box from JP2 file at the given offset
*
- * @param[in] fd file discriptor of the JP2 file
+ * @param[in] fd file descriptor of the JP2 file
* @param[in] offset Box offset
* @return pointer to the structure of generate box parameters
*/
@@ -91,7 +91,7 @@ box_param_t * gene_boxbyOffinStream(Byte_t *stream, OPJ_OFF_T offset);
/**
* generate(search) box from JP2 file
*
- * @param[in] fd file discriptor of the JP2 file
+ * @param[in] fd file descriptor of the JP2 file
* @param[in] offset start Byte position of the search
* @param[in] length Byte length of the search, if 0, size to the end of file
* @param[in] TBox Box Type
diff --git a/src/lib/openjpip/boxheader_manager.h b/src/lib/openjpip/boxheader_manager.h
index b43b447c..9942d59c 100644
--- a/src/lib/openjpip/boxheader_manager.h
+++ b/src/lib/openjpip/boxheader_manager.h
@@ -47,7 +47,7 @@ typedef struct boxheader_param {
/**
* generate a box header at the given offset
*
- * @param[in] fd file discriptor of the JP2 file
+ * @param[in] fd file descriptor of the JP2 file
* @param[in] offset Box offset
* @return pointer to the structure of generate box header parameters
*/
diff --git a/src/lib/openjpip/byte_manager.h b/src/lib/openjpip/byte_manager.h
index 02c806e0..3c7a91be 100644
--- a/src/lib/openjpip/byte_manager.h
+++ b/src/lib/openjpip/byte_manager.h
@@ -42,7 +42,7 @@ typedef uint64_t Byte8_t;
/**
* fetch bytes of data in file stream
*
- * @param[in] fd file discriptor
+ * @param[in] fd file descriptor
* @param[in] offset start Byte position
* @param[in] size Byte length
* @return pointer to the fetched data
@@ -53,7 +53,7 @@ Byte_t * fetch_bytes(int fd, OPJ_OFF_T offset, OPJ_SIZE_T size);
/**
* fetch a 1-byte Byte codes in file stream
*
- * @param[in] fd file discriptor
+ * @param[in] fd file descriptor
* @param[in] offset start Byte position
* @return fetched codes
*/
@@ -62,7 +62,7 @@ Byte_t fetch_1byte(int fd, OPJ_OFF_T offset);
/**
* fetch a 2-byte big endian Byte codes in file stream
*
- * @param[in] fd file discriptor
+ * @param[in] fd file descriptor
* @param[in] offset start Byte position
* @return fetched codes
*/
@@ -71,7 +71,7 @@ Byte2_t fetch_2bytebigendian(int fd, OPJ_OFF_T offset);
/**
* fetch a 4-byte big endian Byte codes in file stream
*
- * @param[in] fd file discriptor
+ * @param[in] fd file descriptor
* @param[in] offset start Byte position
* @return fetched codes
*/
@@ -80,7 +80,7 @@ Byte4_t fetch_4bytebigendian(int fd, OPJ_OFF_T offset);
/**
* fetch a 8-byte big endian Byte codes in file stream
*
- * @param[in] fd file discriptor
+ * @param[in] fd file descriptor
* @param[in] offset start Byte position
* @return fetched codes
*/
@@ -122,7 +122,7 @@ void modify_4Bytecode(Byte4_t code, Byte_t *stream);
/**
* Get file size
*
- * @param[in] fd file discriptor
+ * @param[in] fd file descriptor
* @return file size
*/
OPJ_OFF_T get_filesize(int fd);
diff --git a/src/lib/openjpip/msgqueue_manager.h b/src/lib/openjpip/msgqueue_manager.h
index ad97828d..d0715310 100644
--- a/src/lib/openjpip/msgqueue_manager.h
+++ b/src/lib/openjpip/msgqueue_manager.h
@@ -151,7 +151,7 @@ void enqueue_metadata(Byte8_t meta_id, msgqueue_param_t *msgqueue);
* reconstruct JPT/JPP-stream from message queue
*
* @param[in] msgqueue message queue pointer
- * @param[in] tmpfd file discriptor to write JPT/JPP-stream
+ * @param[in] tmpfd file descriptor to write JPT/JPP-stream
*/
void recons_stream_from_msgqueue(msgqueue_param_t *msgqueue, int tmpfd);
diff --git a/src/lib/openjpip/openjpip.h b/src/lib/openjpip/openjpip.h
index 5913bd0f..a9fab4f8 100644
--- a/src/lib/openjpip/openjpip.h
+++ b/src/lib/openjpip/openjpip.h
@@ -159,7 +159,7 @@ typedef struct dec_server_record {
Byte_t *jpipstream; /**< JPT/JPP stream*/
OPJ_SIZE_T jpipstreamlen; /**< length of jpipstream*/
msgqueue_param_t *msgqueue; /**< parsed message queue of jpipstream*/
- SOCKET listening_socket; /**< listenning socket*/
+ SOCKET listening_socket; /**< listening socket*/
} dec_server_record_t;
diff --git a/src/lib/openjpip/session_manager.h b/src/lib/openjpip/session_manager.h
index 1343b1e7..3e1d2c41 100644
--- a/src/lib/openjpip/session_manager.h
+++ b/src/lib/openjpip/session_manager.h
@@ -57,7 +57,7 @@ sessionlist_param_t * gene_sessionlist(void);
/**
- * generate a session under the sesion list
+ * generate a session under the session list
*
* @param[in] sessionlist session list to insert the new session
* @return pointer to the generated session
diff --git a/src/lib/openjpip/sock_manager.h b/src/lib/openjpip/sock_manager.h
index f33306c0..44054f30 100644
--- a/src/lib/openjpip/sock_manager.h
+++ b/src/lib/openjpip/sock_manager.h
@@ -51,9 +51,9 @@ typedef int SOCKET;
SOCKET open_listeningsocket(uint16_t port);
/**
- * accept a new connection to the listenning socket
+ * accept a new connection to the listening socket
*
- * @param listening_socket listenning socket
+ * @param listening_socket listening socket
* @return connected socket (-1 if error occurs)
*/
SOCKET accept_socket(SOCKET listening_socket);
diff --git a/tests/compare_images.c b/tests/compare_images.c
index f3f87639..9b55e054 100644
--- a/tests/compare_images.c
+++ b/tests/compare_images.c
@@ -939,7 +939,7 @@ int main(int argc, char **argv)
if ( imageToPNG(imageDiff, filenamePNGdiff_it_comp, it_comp) == EXIT_SUCCESS )
{
- printf("<DartMeasurementFile name=\"DiffferenceImage_%d\" type=\"image/png\"> %s </DartMeasurementFile> \n", it_comp, filenamePNGdiff_it_comp);
+ printf("<DartMeasurementFile name=\"DifferenceImage_%d\" type=\"image/png\"> %s </DartMeasurementFile> \n", it_comp, filenamePNGdiff_it_comp);
}
*/
diff --git a/tests/nonregression/CMakeLists.txt b/tests/nonregression/CMakeLists.txt
index 51990577..c3b9578f 100644
--- a/tests/nonregression/CMakeLists.txt
+++ b/tests/nonregression/CMakeLists.txt
@@ -82,8 +82,8 @@ set(BLACKLIST_JPEG2000
issue475.jp2 #kdu_jp2info ok
issue413.jp2 #kdu_jp2info ok
issue823.jp2 #kdu_jp2info ok
- issue826.jp2 #inspection reveales that the transformation value is out of range
- oss-fuzz2785.jp2 #inspection reveales that the transformation value is out of range
+ issue826.jp2 #inspection reveals that the transformation value is out of range
+ oss-fuzz2785.jp2 #inspection reveals that the transformation value is out of range
issue1438.j2k
)
diff --git a/tests/nonregression/test_suite.ctest.in b/tests/nonregression/test_suite.ctest.in
index 584dfaf7..67409f9b 100644
--- a/tests/nonregression/test_suite.ctest.in
+++ b/tests/nonregression/test_suite.ctest.in
@@ -6,7 +6,7 @@
# + For encoder related tests = dump, compare dump to base, decode the encoded file with
# reference and compare the decoded file with the baseline decoded previously with
# ref decoder.
-# + For decoder related tests = dump, compare dump to base, (TODO: compare outpout decoding
+# + For decoder related tests = dump, compare dump to base, (TODO: compare output decoding
# image to base)
#
# Line begin with ! should failed (should be used for bad jpeg2000 file which should be
diff --git a/tests/pdf2jp2.c b/tests/pdf2jp2.c
index 38aa739f..f36ea4f9 100644
--- a/tests/pdf2jp2.c
+++ b/tests/pdf2jp2.c
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
{
#define NUMJP2 32
int i, c = 0;
- long offets[NUMJP2];
+ long offsets[NUMJP2];
char buffer[512];
#define BUFLEN 4096
int cont = 1;
@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
const ptrdiff_t diff = ret - haystack;
assert( diff >= 0 );
/*fprintf( stdout, "Found it: %lx\n", (ptrdiff_t)cpos - (ptrdiff_t)hlen + diff);*/
- offets[c++] = (ptrdiff_t)cpos - (ptrdiff_t)hlen + diff;
+ offsets[c++] = (ptrdiff_t)cpos - (ptrdiff_t)hlen + diff;
}
cont = (nread == flen);
memcpy( haystack, haystack + nread, nlen );
@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
{
int s, len = 0;
char *r;
- const int ret = fseek(f, offets[i], SEEK_SET);
+ const int ret = fseek(f, offsets[i], SEEK_SET);
assert( ret == 0 );
r = fgets(buffer, sizeof(buffer), f);
assert( r );
@@ -105,7 +105,7 @@ int main(int argc, char *argv[])
s = sscanf(r, "JPXDecode]/Length %d/Width %*d/BitsPerComponent %*d/Height %*d", &len);
if( s == 0 )
{ // try again harder
- const int ret = fseek(f, offets[i] - 40, SEEK_SET); // 40 is magic number
+ const int ret = fseek(f, offsets[i] - 40, SEEK_SET); // 40 is magic number
assert( ret == 0 );
r = fgets(buffer, sizeof(buffer), f);
assert( r );
diff --git a/wrapping/java/openjp2/JavaOpenJPEG.c b/wrapping/java/openjp2/JavaOpenJPEG.c
index 85b0c0af..3a996dba 100644
--- a/wrapping/java/openjp2/JavaOpenJPEG.c
+++ b/wrapping/java/openjp2/JavaOpenJPEG.c
@@ -663,7 +663,7 @@ static int parse_cmdline_encoder(int argc, char **argv,
/* ----------------------------------------------------- */
- case 'r': { /* rates rates/distorsion */
+ case 'r': { /* rates rates/distortion */
char *s = opj_optarg;
while (sscanf(s, "%f", &parameters->tcp_rates[parameters->tcp_numlayers]) ==
1) {
@@ -1452,7 +1452,7 @@ static char* create_index_into_byte_array(opj_codestream_info_t *cstr_info,
+ (10 /* image_w until decomposition */
+ (cstr_info->numdecompos[0] + 1) * 2 /* pdx size for each tile */
+ 2 /* main_head_end + codestream_size */
- + cstr_info->tw * cstr_info->th * 4 /* tile info, without distorsion info */
+ + cstr_info->tw * cstr_info->th * 4 /* tile info, without distortion info */
+ cstr_info->tw * cstr_info->th * cstr_info->numlayers *
(cstr_info->numdecompos[0] + 1) * cstr_info->numcomps * prec_max * 8
) * sizeof(int);