From 553714a87a92930dd69f5762e0615c12dfcbd873 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Fri, 9 Oct 2015 15:37:09 +0200 Subject: Make sure to allocate on 16bits alignement. Fix issue #624 --- src/lib/openjp2/tcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/openjp2/tcd.c b/src/lib/openjp2/tcd.c index 2fccff1c..3feb74ca 100644 --- a/src/lib/openjp2/tcd.c +++ b/src/lib/openjp2/tcd.c @@ -626,7 +626,7 @@ void opj_tcd_destroy(opj_tcd_t *tcd) { OPJ_BOOL opj_alloc_tile_component_data(opj_tcd_tilecomp_t *l_tilec) { if ((l_tilec->data == 00) || ((l_tilec->data_size_needed > l_tilec->data_size) && (l_tilec->ownsData == OPJ_FALSE))) { - l_tilec->data = (OPJ_INT32 *) opj_malloc(l_tilec->data_size_needed); + l_tilec->data = (OPJ_INT32 *) opj_aligned_malloc(l_tilec->data_size_needed); if (! l_tilec->data ) { return OPJ_FALSE; } -- cgit v1.2.3 From de0a9ed10302f94e1d0808ab4e88d6152742cb04 Mon Sep 17 00:00:00 2001 From: mayeut Date: Fri, 9 Oct 2015 21:13:06 +0200 Subject: Revert "Make sure to allocate on 16bits alignement. Fix issue #624" This reverts commit 553714a87a92930dd69f5762e0615c12dfcbd873. --- src/lib/openjp2/tcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/openjp2/tcd.c b/src/lib/openjp2/tcd.c index 3feb74ca..2fccff1c 100644 --- a/src/lib/openjp2/tcd.c +++ b/src/lib/openjp2/tcd.c @@ -626,7 +626,7 @@ void opj_tcd_destroy(opj_tcd_t *tcd) { OPJ_BOOL opj_alloc_tile_component_data(opj_tcd_tilecomp_t *l_tilec) { if ((l_tilec->data == 00) || ((l_tilec->data_size_needed > l_tilec->data_size) && (l_tilec->ownsData == OPJ_FALSE))) { - l_tilec->data = (OPJ_INT32 *) opj_aligned_malloc(l_tilec->data_size_needed); + l_tilec->data = (OPJ_INT32 *) opj_malloc(l_tilec->data_size_needed); if (! l_tilec->data ) { return OPJ_FALSE; } -- cgit v1.2.3 From 51a67a9cbf09efe91c4d79dc0e841b2d10db89be Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Mon, 12 Oct 2015 21:25:53 +0200 Subject: Minor style fix to remove c++ comments --- src/bin/common/color.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/bin/common/color.c b/src/bin/common/color.c index 3b0eb97b..0f2b8dac 100644 --- a/src/bin/common/color.c +++ b/src/bin/common/color.c @@ -617,7 +617,7 @@ void color_cielab_to_rgb(opj_image_t *image) default_type = (unsigned int)row[1]; - if(default_type == 0x44454600)// DEF : default + if(default_type == 0x44454600)/* DEF : default */ { rl = 100; ra = 170; rb = 200; ol = 0; @@ -679,9 +679,9 @@ void color_cielab_to_rgb(opj_image_t *image) } fprintf(stderr,"%s:%d:\n\tenumCS %d not handled. Ignoring.\n", __FILE__,__LINE__, enumcs); -}// color_apply_conversion() +}/* color_apply_conversion() */ -#endif // OPJ_HAVE_LIBLCMS2 || OPJ_HAVE_LIBLCMS1 +#endif /* OPJ_HAVE_LIBLCMS2 || OPJ_HAVE_LIBLCMS1 */ void color_cmyk_to_rgb(opj_image_t *image) { @@ -732,11 +732,11 @@ void color_cmyk_to_rgb(opj_image_t *image) memcpy(&(image->comps[i]), &(image->comps[i+1]), sizeof(image->comps[i])); } -}// color_cmyk_to_rgb() +}/* color_cmyk_to_rgb() */ -// -// This code has been adopted from sjpx_openjpeg.c of ghostscript -// +/* + * This code has been adopted from sjpx_openjpeg.c of ghostscript + */ void color_esycc_to_rgb(opj_image_t *image) { int y, cb, cr, sign1, sign2, val; @@ -785,4 +785,4 @@ void color_esycc_to_rgb(opj_image_t *image) } image->color_space = OPJ_CLRSPC_SRGB; -}// color_esycc_to_rgb() +}/* color_esycc_to_rgb() */ -- cgit v1.2.3 From 26dcb7c1253fc38d1ff0838986dc2d87825cd194 Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Mon, 12 Oct 2015 21:29:12 +0200 Subject: Remove a possible uninitialized variable Fixes #629 --- src/lib/openjp3d/jp3d.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/lib/openjp3d/jp3d.c b/src/lib/openjp3d/jp3d.c index f445fb36..9e060df7 100644 --- a/src/lib/openjp3d/jp3d.c +++ b/src/lib/openjp3d/jp3d.c @@ -1008,6 +1008,7 @@ static void j3d_write_qcx(opj_j3d_t *j3d, int compno) { cio_write(cio, tccp->qntsty + (tccp->numgbits << 5), 1); /* Sqcx : Table A28 de 15444-1*/ + numbands = 0; // compiler warning if (j3d->cinfo->codec_format == CODEC_J2K) numbands = tccp->qntsty == J3D_CCP_QNTSTY_SIQNT ? 1 : tccp->numresolution[0] * 3 - 2; else if (j3d->cinfo->codec_format == CODEC_J3D) { -- cgit v1.2.3 From 98324bbd6baf8b664f6937efe5247d061aa49a8a Mon Sep 17 00:00:00 2001 From: Giuseppe Baruffa Date: Tue, 13 Oct 2015 15:20:54 +0200 Subject: I do not recall exactly... I would say that the correct version should be if (!JPWL_ASSUME) return false; meaning that once JPWL_ASSUME=1 the code will pass over such errors and try to decode anyway (just paired with the other JPWL_ASSUME on line 1112). Fixes #596 --- src/lib/openjpwl/jpwl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/openjpwl/jpwl.c b/src/lib/openjpwl/jpwl.c index 79d0e04c..99a34990 100644 --- a/src/lib/openjpwl/jpwl.c +++ b/src/lib/openjpwl/jpwl.c @@ -1296,7 +1296,7 @@ opj_bool jpwl_check_tile(opj_j2k_t *j2k, opj_tcd_t *tcd, int tileno) { opj_event_msg(j2k->cinfo, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR, "JPWL: wrong x-cord of block origin %d => x-prec is (%d, %d)\n", block->x0, prec->x0, prec->x1); - if (!JPWL_ASSUME || JPWL_ASSUME) + if (!JPWL_ASSUME) return OPJ_FALSE; }; } -- cgit v1.2.3 From 372fead0d7af3b955eb8c687067b817faa3ea41c Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Tue, 13 Oct 2015 21:07:11 +0200 Subject: Remove the explicit restrict keyword It would trigger a compiler error on xlc compiler. Fixes #620 --- src/lib/openjp2/dwt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib/openjp2/dwt.c b/src/lib/openjp2/dwt.c index 4ad99ed9..eead5865 100644 --- a/src/lib/openjp2/dwt.c +++ b/src/lib/openjp2/dwt.c @@ -741,8 +741,8 @@ static void opj_v4dwt_decode_step1(opj_v4_t* w, OPJ_INT32 count, const OPJ_FLOAT static void opj_v4dwt_decode_step2(opj_v4_t* l, opj_v4_t* w, OPJ_INT32 k, OPJ_INT32 m, OPJ_FLOAT32 c) { - OPJ_FLOAT32* restrict fl = (OPJ_FLOAT32*) l; - OPJ_FLOAT32* restrict fw = (OPJ_FLOAT32*) w; + OPJ_FLOAT32* fl = (OPJ_FLOAT32*) l; + OPJ_FLOAT32* fw = (OPJ_FLOAT32*) w; OPJ_INT32 i; for(i = 0; i < m; ++i){ OPJ_FLOAT32 tmp1_1 = fl[0]; -- cgit v1.2.3