Commit Graph

22 Commits

Author SHA1 Message Date
Even Rouault 0b5d62684f
API: deprecate 'bpp' member in favor of 'prec'
in opj_image_comp and opj_image_comptparm structures.

bpp was redundant with prec, and almost never set by the library, except
by opj_image_create(). This change should hopefully not impact existing,
working, users of the API, which should already have used prec to get
things working.

Fixes #1379
2021-10-21 14:13:58 +02:00
Jamaika1 8fc4bf8ecb
Use standard integer types for compatibility with libtiff 4.3.0 (#1377) 2021-09-12 12:32:38 +02:00
Even Rouault 1c54024165
opj_decompress: add sanity checks to avoid segfault in case of decoding error
Prevent crashes like:
opj_decompress -i 0722_5-1_2019.jp2 -o out.ppm -r 4 -t 0

where 0722_5-1_2019.jp2 is
https://drive.google.com/file/d/1ZxOUZg2-FKjYwa257VFLMpTXRWxEoP0a/view?usp=sharing
2020-04-01 21:11:36 +02:00
Stefan Weil 948332e6ed Fix some potential overflow issues (#1161)
* Fix some potential overflow issues

Put sizeof to the beginning of the multiplication to enforce that
size_t instead of smaller integer types is used for the calculation.

This fixes warnings from LGTM:

    Multiplication result may overflow 'unsigned int'
    before it is converted to 'unsigned long'.

It also allows removing some type casts.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* Fix code indentation

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-10-31 20:44:30 +01:00
Even Rouault af76000771 tiftoimage(): fix read heap buffer overflow (#988)
The number of components is given only by TIFFTAG_SAMPLESPERPIXEL / tiSpp.
Querying TIFFTAG_EXTRASAMPLES only give information about which channel is
the alpha channel, but we mostly ignore it for now, so remove that part of the
code.
2017-08-16 13:36:52 +02:00
szukw000 9f750884f9 Changes in converttif.c for PPC64 2017-08-11 00:06:23 +02:00
Antonin Descampe 0c07950cb3 Fix remaining warning
format specifier mismatch in #975
2017-08-08 18:05:37 -07:00
szukw000 bc3cb74100 Changes for converttif.c to fix tsize_t 2017-08-07 16:44:28 +02:00
szukw000 57e36dbfeb First change on changes-for-afl-tests 2017-08-02 17:27:08 +02:00
szukw000 00f45684a8 Catch images broken by AFL 2017-07-31 13:58:08 +02:00
Even Rouault 563bd8499e Reformat whole codebase with astyle.options (#128) 2017-05-09 20:46:20 +02:00
mayeut 74e814358c Allow to write 3/5/7/9/11/13/15 bpp TIF files
Update uclouvain/openjpeg#729
2016-04-23 04:29:03 +02:00
mayeut 54393d9e38 Allow to read 3/5/7/9/11/13/15 bpp TIF files 2016-04-23 04:24:04 +02:00
Stefan Weil c8ae3c5225 Fix warnings for C++
g++ complains about invalid conversions like these ones:

error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
error: invalid conversion from ‘void*’ to ‘opj_precision* {aka opj_prec*}’ [-fpermissive]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-10-07 20:53:57 +02:00
mayeut f98df1c715 TIFF can output CMYK 2015-08-21 19:54:22 +02:00
mayeut f3dad25c77 Update convert for PNG output
Update uclouvain/openjpeg#264
2015-07-26 18:28:03 +02:00
mayeut c423cc84e7 Remove some warnings when building
Update #442
2015-07-26 02:41:39 +02:00
mayeut 46c1dd22fc Correct error message for invalid TIFF input 2015-07-19 15:01:12 +02:00
mayeut 8048bbc7a2 Add tests for TIFF input with Alpha channel
Update uclouvain/openjpeg#322
2015-07-18 00:07:04 +02:00
mayeut 635a358962 Fix build warnings in converttif.c 2015-07-16 06:51:21 +02:00
mayeut 8f798864a9 Update imagetotif to support more output TIF formats
Update uclouvain/openjpeg#322
Update uclouvain/openjpeg#264
2015-07-16 00:26:02 +02:00
mayeut ac9fb5a302 Update tiftoimage to support more input TIF formats
Update uclouvain/openjpeg#322
Update uclouvain/openjpeg#264
2015-07-14 23:51:02 +02:00