Commit Graph

22 Commits

Author SHA1 Message Date
Antonin Descampe 25966346f7 Fix warnings from recent overflow checks
see #832
2016-09-16 17:48:20 +02:00
mayeut 43557dcd3b Add overflow checks for opj_aligned_malloc
See
https://pdfium.googlesource.com/pdfium/+/b20ab6c7acb3be1393461eb650ca8fa
4660c937e/third_party/libopenjpeg20/0020-opj_aligned_malloc.patch
2016-09-13 21:05:30 +02:00
Matthieu Darbois c8fbf0f516 Change 'restrict' define to 'OPJ_RESTRICT' (#816)
Visual Studio 2015 does not pass regression tests with `__restrict` so kept disabled for MSVC.
Need to check proper usage of OPJ_RESTRICT (if correct then there’s
probably a bug  in vc14)

Closes #661
2016-09-13 11:00:07 +02:00
Even Rouault 6a1974d40d Add comment explaining bj is not use when l_data_size == 0 2016-01-09 14:30:48 +01:00
Even Rouault 87c0d7dc1e [git/2.1 regression] Fix opj_write_tile() failure when numresolutions=1
When trying the GDAL OpenJPEG driver against openjpeg current master HEAD,
I get failures when trying to create .jp2 files. The driver uses
opj_write_tile() and in some tests numresolutions = 1.

In openjp2/dwt.c:410, l_data_size = opj_dwt_max_resolution( tilec->resolutions,tilec->numresolutions) * (OPJ_UINT32)sizeof(OPJ_INT32);
is called and returns l_data_size = 0. Now in git opj_malloc() has a special case
for 0 to return a NULL pointer whereas previously it relied on system malloc(),
which in my case didn't return NULL.

So only test the pointer value if l_data_size != 0. This makes the GDAL
autotest suite to pass again.
2016-01-08 19:38:45 +01:00
Stephan Mühlstrasser a1fc83cc25 Fix HP compiler warning about redeclaration of function (#640)
HP compiler warns:
cc: "dwt.c", line 798: warning 562: Redeclaration of "opj_v4dwt_decode"
with a different storage class specifier: "opj_v4dwt_decode" will have
internal linkage.
cc: "t2.c", line 1341: warning 562: Redeclaration of "opj_t2_init_seg"
with a different storage class specifier: "opj_t2_init_seg" will have
internal linkage.
2015-10-19 12:14:27 +02:00
Matthieu Darbois 05b3afd28f Merge pull request #636 from uclouvain/opj_malloc-625
Update allocation functions
Fix #625 
Fix #624
Fix #635
2015-10-18 03:14:55 +02:00
mayeut 8034ffde8b Fix inconsistent behavior of malloc(0)
Update #635
Update #625
2015-10-17 02:55:09 +02:00
Mathieu Malaterre 372fead0d7 Remove the explicit restrict keyword
It would trigger a compiler error on xlc compiler.  Fixes #620
2015-10-13 21:07:11 +02:00
mayeut ae4799ad07 Add some missing static
Still needs to check j2k.c & jp2.c
Update uclouvain/openjpeg#243
2015-07-18 02:39:32 +02:00
Antonin Descampe 6868ee373e added memory allocation checks (fixes issue 355) 2014-09-19 10:26:35 +00:00
Antonin Descampe d19a4ab676 [trunk] updated copyright and added copyright notice required by ISO, in each file; updated AUTHORS, NEWS 2014-04-03 15:30:57 +00:00
Mathieu Malaterre 9d21695476 [trunk] As reported by clang analyzer thoses values were never read 2014-03-07 11:20:59 +00:00
Mathieu Malaterre 7b335eb635 [trunk] Another of fixes for warning about sign conversion
Update issue 256
2014-03-07 10:19:39 +00:00
Mathieu Malaterre 11f402b44a [trunk] Remove easy to fix warnings about conversion 2014-03-03 12:00:24 +00:00
Mickael Savinaud fcf9fa3651 [trunk] add opj_ prefix to some internal define and use the new opj type instead of int and float in some files 2012-11-16 08:29:43 +00:00
Mickael Savinaud ec0fe09138 [trunk] move opj_bool to OPJ_BOOL to follow the other type 2012-11-15 13:13:36 +00:00
Mickael Savinaud 06615a556d [trunk] rename opj_tcd_truct_v2 to opj_tcd_struct 2012-10-25 14:49:10 +00:00
Mickael Savinaud 216791c3fb [trunk] Finalize dwt.v/.h with the v2 style : remove last functions already optimized, add opj_ prefix, use new name of the functions 2012-10-24 09:29:34 +00:00
Mickael Savinaud 4b140e060b [trunk] rename int.h to opj_intmath.h and rename all its functions with opj_ prefix 2012-10-05 09:10:15 +00:00
Mickael Savinaud 3a46e2d86b [trunk] correct warnings linked to static dwt functions because declaration is not hide when we use SSE 2012-10-03 09:52:09 +00:00
Mathieu Malaterre d518970039 [trunk] Start FolderReorgProposal task
Update issue 177
2012-09-28 08:11:41 +00:00