Commit Graph

65 Commits

Author SHA1 Message Date
Matthieu Darbois e078172b1c Add sanity check for tile coordinates (#823)
Coordinates are casted from OPJ_UINT32 to OPJ_INT32
Add sanity check for negative values and upper bound becoming lower
than lower bound.
See also
https://pdfium.googlesource.com/pdfium/+/b6befb2ed2485a3805cddea86dc7574510178ea9
2016-09-08 00:24:15 +02:00
Matthieu Darbois ea320dab8b Add overflow check in opj_tcd_init_tile (#819) 2016-09-06 07:54:29 +02:00
mayeut 8f9cc62b3f Fix division by zero
Fix uclouvain/openjpeg#733
2016-05-08 18:40:12 +02:00
mayeut cd77b6003b Fix some coverity warnings 2016-04-30 12:15:22 +02:00
julienmalik e982d03966 Fix implicit float-to-bool conversions (#752) 2016-04-28 11:52:45 +02:00
Matthieu Darbois 66fd497765 Fix unsigned int overflow reported by UBSan (#759) 2016-04-28 00:18:37 +02:00
Matthieu Darbois e6881e7527 Fix negative shift left reported by UBSan (#758)
Follow-up of #757

This shall have no performance impact on 2’s complement machine where
the compiler replaces the multiplication by power of two (constant) by
a left shift.
Verified at least on MacOS Xcode 7.3, same assembly generated after fix.
2016-04-27 21:56:09 +02:00
mayeut 8034ffde8b Fix inconsistent behavior of malloc(0)
Update #635
Update #625
2015-10-17 02:55:09 +02:00
mayeut 83249c318f Fixed crash on encoding
Update #624
Update #625
2015-10-17 01:30:23 +02:00
Mathieu Malaterre d753441028 implement a portable aligned realloc 2015-10-10 17:51:29 +02:00
mayeut de0a9ed103 Revert "Make sure to allocate on 16bits alignement. Fix issue #624"
This reverts commit 553714a87a.
2015-10-09 21:13:06 +02:00
Mathieu Malaterre 553714a87a Make sure to allocate on 16bits alignement. Fix issue #624 2015-10-09 15:37:09 +02:00
Matthieu Darbois bac2c9e0a3 Change test in opj_tcd_makelayer
Remove float equality test. Such a test has no meaning.
2015-09-11 14:17:30 +02:00
Matthieu Darbois ee0f313848 Update check in opj_tcd_makelayer to be robust to different float precisions 2015-09-10 15:46:51 +02:00
Matthieu Darbois ccdce606f1 Fix threshold calculation
It doesn't change the outcome of the test suite, that's weird...
2015-09-10 15:10:14 +02:00
mayeut 5f02757eef Correct lossless issue on linux x86
Update uclouvain/openjpeg#571
2015-09-10 00:39:23 +02:00
mayeut 38770403d4 Fix some calculations in opj_tcd_init_tile
Fixes #486
Fixes #394
Update #480
Update #388
2015-08-23 11:38:04 +02:00
mayeut 0df90afdf7 Remove printf/fprintf to stdout/stderr throughout openjp2 lib
Update uclouvain/openjpeg#246
2015-07-30 23:26:31 +02:00
mayeut c423cc84e7 Remove some warnings when building
Update #442
2015-07-26 02:41:39 +02:00
mayeut 9ac3a1572e Prevent overflow when coding 16 bits images
Update uclouvain/openjpeg#539
2015-07-22 00:10:32 +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 2d24b6000d [trunk] added overflow checks (fixes issue 431)
Thanks mdarbois
2015-02-02 16:11:31 +00:00
Antonin Descampe 5d00b719f4 [trunk] fixed a buffer overflow in opj_tcd_init_decode_tile
Update issue 431
2015-01-15 18:16:29 +00:00
Matthieu Darbois 9a21e1eef0 [trunk] removed warnings when building tcd.c (Update issue 442) 2014-12-15 18:48:50 +00:00
Matthieu Darbois e05d2901ec [trunk] Reduce encoder code block memory usage for non 64x64 code block sizes (fixes issue 444) 2014-12-12 21:54:22 +00:00
Antonin Descampe 8d320bbdf8 [trunk] check number of components when getting mct norm (fixes issue 436) 2014-12-09 12:09:08 +00:00
Matthieu Darbois 548aff34f4 [trunk] added check for tile component data size overflow (fixes issue 432) 2014-11-21 21:35:43 +00:00
Matthieu Darbois ae1da37558 [trunk] replace OPJ_MACRO_TCD_ALLOCATE macro by inlined function (fixes issue 433) 2014-11-19 19:08:09 +00:00
Antonin Descampe c3629e37a2 [trunk] significantly reduces memory for single tile RGB encoding (fixes
issue 375)
2014-11-03 14:51:41 +00:00
Antonin Descampe 3e1fad2da4 [trunk] resets resno_decoded for each tile (fixes issue 399) 2014-10-22 13:16:35 +00:00
Antonin Descampe d72940c56b [trunk] resets code-blocks reused for other tiles than the first one (fixes issue 418) 2014-10-22 13:16:12 +00:00
Antonin Descampe 6868ee373e added memory allocation checks (fixes issue 355) 2014-09-19 10:26:35 +00:00
Antonin Descampe 50a205d20f [trunk] improve memory management (fixes issue 359) 2014-09-16 15:48:04 +00:00
Antonin Descampe 7199d9b5d3 [trunk] refactoring of rsiz, profiles, and extensions management 2014-04-17 09:31:37 +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 3a80b72ac8 [trunk] Add a temporary work around for issue 293
As described in the bug report the default allocation mecanism for codeblock data is too small for those dataset (16bits). We would need a finer (more granular) mecanism to reallocated only on demand. For now this help the two failing tests to pass.
Fixes issue 293
2014-03-14 10:54:08 +00:00
Mathieu Malaterre 2e7b8fb9a1 [trunk] Another final round of fixes for sign conversion warnings.
Fixes issue 256
2014-03-10 16:43:04 +00:00
Mathieu Malaterre cc1354ebfa [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-07 14:00:47 +00:00
Mathieu Malaterre 1ef677f264 [trunk] Make sure to reject images such as 1336.pdf.asan.47.376.jp2
Fixes issue 267
2014-03-04 10:32:26 +00:00
Mathieu Malaterre 07193e2a34 [trunk] remove more conversion warning in multi-lines macro.
C allow simple tricks such as to find those:
gcc -E tcd.c | sed '/^\#/d' | indent -st -i2 > clean.c
Update issue 256
2014-03-04 09:58:07 +00:00
Mathieu Malaterre 7185faa857 [trunk] Remove warning about conversion.
Update issue 256
2014-03-04 09:19:49 +00:00
Mathieu Malaterre 2c876b6765 [trunk] Remove simple warnings about comments, missing case in switch statement 2014-03-02 10:16:54 +00:00
Mathieu Malaterre 23ea270881 [trunk] Import patch from sumatrapdf team. This handle testcase 1336.pdf.asan.47.376
Update issue 225
2014-02-26 11:27:01 +00:00
Mathieu Malaterre 7247543da3 [trunk] Import patch from sumatrapdf team. This handle testcase 1888.pdf.asan.35.988
Update issue 225
2014-02-26 11:26:09 +00:00
Mickael Savinaud 8b36a11f2b [trunk] backout one part of the rev 2266 2013-02-03 09:07:23 +00:00
Mickael Savinaud b65bf48369 [trunk] merge from branch 1.5 a correction about large code-block data (decoding part) and add tests about issue 5 and issue 62 2012-12-18 17:46:33 +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 d5efeb7df5 [trunk]update the copyright, the authors and thanks to respect the license 2012-11-15 15:22:29 +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 84c93c2fea [trunk] rename public symbols with OPJ_ prefix 2012-11-15 12:25:11 +00:00