summaryrefslogtreecommitdiff
path: root/src/lib/openjp2/tcd.c
AgeCommit message (Collapse)Author
2017-08-07Add documentation for magic values in the codeEven Rouault
2017-08-07Add opj_image_data_alloc() / opj_image_data_free()Even Rouault
As bin/common/color.c used to directly call malloc()/free(), we need to export functions dedicated to allocating/freeing image component data.
2017-07-30opj_tcd_dc_level_shift_decode: avoid int32 overflow when prec == 31. Fixes ↵Even Rouault
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2799. Credit to OSS Fuzz
2017-07-29Fix write heap buffer overflow in opj_mqc_byteout(). Discovered by Ke Liu of ↵Even Rouault
Tencent's Xuanwu LAB (#835)
2017-07-29opj_tcd_get_decoded_tile_size(): fix potential UINT32 overflow (#854, ↵Even Rouault
CVE-2016-5152) Fix derived from https://pdfium.googlesource.com/pdfium.git/+/d8cc503575463ff3d81b22dad292665f2c88911e/third_party/libopenjpeg20/0018-tcd_get_decoded_tile_size.patch
2017-07-28opj_tcd_dc_level_shift_decode(): avoid int overflow. Fixes ↵Even Rouault
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2516. Credit to OSS Fuzz
2017-07-27opj_j2k_update_image_data / opj_tcd_update_tile_data: fix unaligned ↵Even Rouault
load/store (#895) When components don't have the same width, unaligned load/store are possible. Fixes openjeg-crashes-2017-07-27/id:000000,sig:11,src:001342,op:flip4,pos:162.jp2 of #895
2017-07-26T1 decoder: check code stream errors when predictable termination is enabled ↵Even Rouault
and emit a warning when errors are found
2017-06-13Merge branch 't1_flag_optimizations'Even Rouault
2017-06-12Encoder: fix packet writing of empty sub-bands (#891, #892)Even Rouault
There are situations where, given a tile size, at a resolution level, there are sub-bands with x0==x1 or y0==y1, that consequently don't have any valid codeblocks, but the other sub-bands may be non-empty. Given that we recycle the memory from one tile to another one, those ghost codeblocks might be non-0 and thus candidate for packet inclusion.
2017-06-09T1: fix BYPASS/LAZY, TERMALL/RESTART and PTERM/ERTERM encoding modes. (#674)fix_bypass_pterm_termallEven Rouault
There were a number of defects regarding when and how the termination of passes had to done and the computation of their rate.
2017-06-02MQC/RAW decoder: use an artificial 0xFF 0xFF terminating marker.Even Rouault
This saves comparing the current pointer with the end of buffer pointer. This results at least in tiny speed improvement for raw decoding, and smaller code size for MQC as well. This kills the remains of the raw.h/.c files that were only used for decoding. Encoding using the mqc structure already.
2017-05-09Reformat whole codebase with astyle.options (#128)Even Rouault
2017-02-13Remove warnings related to empty tag-trees.Even Rouault
Decoding some valid .jp2 files like Sentinel2 datasets leads to warnings like: No incltree created. tgt_create tree->numnodes == 0, no tree created. No imsbtree created. tgt_create tree->numnodes == 0, no tree created. Besides that, the image is correctly decoded. So there is no reason to emit those warnings.
2016-09-08Merge branch 'master' of https://github.com/uclouvain/openjpeg into ↵Even Rouault
tier1_optimizations_multithreading_2 Conflicts: src/lib/openjp2/t1.c
2016-09-08Add sanity check for tile coordinates (#823)Matthieu Darbois
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-06Add overflow check in opj_tcd_init_tile (#819)Matthieu Darbois
2016-05-25Use thread pool for DWT decodingEven Rouault
2016-05-25Use thread-pool for T1 decodingEven Rouault
2016-05-25Add opj_codec_set_threads() in public API and propagate resulting thread ↵Even Rouault
pool to tcd level By default, only the main thread is used. If opj_codec_set_threads() is not used, but the OPJ_NUM_THREADS environment variable is set, its value will be used to initialize the number of threads. The value can be either an integer number, or "ALL_CPUS". If OPJ_NUM_THREADS is set and this function is called, this function will override the behaviour of the environment variable.
2016-05-08Fix division by zeromayeut
Fix uclouvain/openjpeg#733
2016-04-30Fix some coverity warningsmayeut
2016-04-28Fix implicit float-to-bool conversions (#752)julienmalik
2016-04-28Fix unsigned int overflow reported by UBSan (#759)Matthieu Darbois
2016-04-27Fix negative shift left reported by UBSan (#758)Matthieu Darbois
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.
2015-10-17Fix inconsistent behavior of malloc(0)mayeut
Update #635 Update #625
2015-10-17Fixed crash on encodingmayeut
Update #624 Update #625
2015-10-10implement a portable aligned reallocMathieu Malaterre
2015-10-09Revert "Make sure to allocate on 16bits alignement. Fix issue #624"mayeut
This reverts commit 553714a87a92930dd69f5762e0615c12dfcbd873.
2015-10-09Make sure to allocate on 16bits alignement. Fix issue #624Mathieu Malaterre
2015-09-11Change test in opj_tcd_makelayerMatthieu Darbois
Remove float equality test. Such a test has no meaning.
2015-09-10Update check in opj_tcd_makelayer to be robust to different float precisionsMatthieu Darbois
2015-09-10Fix threshold calculationMatthieu Darbois
It doesn't change the outcome of the test suite, that's weird...
2015-09-10Correct lossless issue on linux x86mayeut
Update uclouvain/openjpeg#571
2015-08-23Fix some calculations in opj_tcd_init_tilemayeut
Fixes #486 Fixes #394 Update #480 Update #388
2015-07-30Remove printf/fprintf to stdout/stderr throughout openjp2 libmayeut
Update uclouvain/openjpeg#246
2015-07-26Remove some warnings when buildingmayeut
Update #442
2015-07-22Prevent overflow when coding 16 bits imagesmayeut
Update uclouvain/openjpeg#539
2015-07-18Add some missing staticmayeut
Still needs to check j2k.c & jp2.c Update uclouvain/openjpeg#243
2015-02-02[trunk] added overflow checks (fixes issue 431)Antonin Descampe
Thanks mdarbois
2015-01-15[trunk] fixed a buffer overflow in opj_tcd_init_decode_tileAntonin Descampe
Update issue 431
2014-12-15[trunk] removed warnings when building tcd.c (Update issue 442)Matthieu Darbois
2014-12-12[trunk] Reduce encoder code block memory usage for non 64x64 code block ↵Matthieu Darbois
sizes (fixes issue 444)
2014-12-09[trunk] check number of components when getting mct norm (fixes issue 436)Antonin Descampe
2014-11-21[trunk] added check for tile component data size overflow (fixes issue 432)Matthieu Darbois
2014-11-19[trunk] replace OPJ_MACRO_TCD_ALLOCATE macro by inlined function (fixes ↵Matthieu Darbois
issue 433)
2014-11-03[trunk] significantly reduces memory for single tile RGB encoding (fixesAntonin Descampe
issue 375)
2014-10-22[trunk] resets resno_decoded for each tile (fixes issue 399)Antonin Descampe
2014-10-22[trunk] resets code-blocks reused for other tiles than the first one (fixes ↵Antonin Descampe
issue 418)
2014-09-19added memory allocation checks (fixes issue 355)Antonin Descampe