<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openjpeg/src/bin/jp2/convertbmp.c, branch master</title>
<subtitle>Fork of openjpeg library for JPEG2000 encoding and decoding</subtitle>
<id>https://git.carlh.net/cgit/openjpeg/atom?h=master</id>
<link rel='self' href='https://git.carlh.net/cgit/openjpeg/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/'/>
<updated>2024-02-28T15:23:43Z</updated>
<entry>
<title>Fix some typos (found by `codespell` and `typos`)</title>
<updated>2024-02-28T15:23:43Z</updated>
<author>
<name>Stefan Weil</name>
<email>sw@weilnetz.de</email>
</author>
<published>2024-02-28T14:28:51Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=20ad29f497cf1afacb243c0019069ba10a0320bd'/>
<id>urn:sha1:20ad29f497cf1afacb243c0019069ba10a0320bd</id>
<content type='text'>
Signed-off-by: Stefan Weil &lt;sw@weilnetz.de&gt;
</content>
</entry>
<entry>
<title>API: deprecate 'bpp' member in favor of 'prec'</title>
<updated>2021-10-21T12:13:58Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2021-10-21T10:43:50Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=0b5d62684fe360e098e3bccaef02ee3e9781cec4'/>
<id>urn:sha1:0b5d62684fe360e098e3bccaef02ee3e9781cec4</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>bmp_read_rle4_data(): avoid potential infinite loop</title>
<updated>2019-04-15T08:10:18Z</updated>
<author>
<name>Young Xiao</name>
<email>YangX92@hotmail.com</email>
</author>
<published>2019-03-16T12:09:59Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=3aef207f90e937d4931daf6d411e092f76d82e66'/>
<id>urn:sha1:3aef207f90e937d4931daf6d411e092f76d82e66</id>
<content type='text'>
</content>
</entry>
<entry>
<title>convertbmp: detect invalid file dimensions early</title>
<updated>2019-04-15T08:10:18Z</updated>
<author>
<name>Young Xiao</name>
<email>YangX92@hotmail.com</email>
</author>
<published>2019-03-16T11:57:27Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=21399f6b7d318fcdf4406d5e88723c4922202aa3'/>
<id>urn:sha1:21399f6b7d318fcdf4406d5e88723c4922202aa3</id>
<content type='text'>
width/length dimensions read from bmp headers are not necessarily
valid. For instance they may have been maliciously set to very large
values with the intention to cause DoS (large memory allocation, stack
overflow). In these cases we want to detect the invalid size as early
as possible.

This commit introduces a counter which verifies that the number of
written bytes corresponds to the advertized width/length.

See commit 8ee335227bbc for details.

Signed-off-by: Young Xiao &lt;YangX92@hotmail.com&gt;
</content>
</entry>
<entry>
<title>convertbmp: detect invalid file dimensions early</title>
<updated>2018-12-14T04:10:35Z</updated>
<author>
<name>Hugo Lefeuvre</name>
<email>hle@debian.org</email>
</author>
<published>2018-12-14T03:58:40Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=8ee335227bbcaf1614124046aa25e53d67b11ec3'/>
<id>urn:sha1:8ee335227bbcaf1614124046aa25e53d67b11ec3</id>
<content type='text'>
width/length dimensions read from bmp headers are not necessarily
valid. For instance they may have been maliciously set to very large
values with the intention to cause DoS (large memory allocation, stack
overflow). In these cases we want to detect the invalid size as early
as possible.

This commit introduces a counter which verifies that the number of
written bytes corresponds to the advertized width/length.

Fixes #1059 (CVE-2018-6616).
</content>
</entry>
<entry>
<title>Fix some potential overflow issues (#1161)</title>
<updated>2018-10-31T19:44:30Z</updated>
<author>
<name>Stefan Weil</name>
<email>sw@weilnetz.de</email>
</author>
<published>2018-10-31T19:44:30Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=948332e6ed17565100d1df5f6fdbf66865218e36'/>
<id>urn:sha1:948332e6ed17565100d1df5f6fdbf66865218e36</id>
<content type='text'>
* 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 &lt;sw@weilnetz.de&gt;

* Fix code indentation

Signed-off-by: Stefan Weil &lt;sw@weilnetz.de&gt;
</content>
</entry>
<entry>
<title>convertbmp: fix issues with zero bitmasks</title>
<updated>2018-09-22T18:51:50Z</updated>
<author>
<name>Hugo Lefeuvre</name>
<email>hle@debian.org</email>
</author>
<published>2018-09-22T18:33:19Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=ca16fe55014c57090dd97369256c7657aeb25975'/>
<id>urn:sha1:ca16fe55014c57090dd97369256c7657aeb25975</id>
<content type='text'>
In the case where a BMP file declares compression 3 (BI_BITFIELDS)
with header size &lt;= 56, all bitmask values keep their initialization
value 0. This may lead to various undefined behavior later e.g. when
doing 1 &lt;&lt; (l_comp-&gt;prec - 1).

This issue does not affect files with bit count 16 because of a check
added in 16240e2 which sets default values to the color masks if they
are all 0.

This commit adds similar checks for the 32 bit case.

Also, if a BMP file declares compression 3 with header size &gt;= 56 and
intentional 0 bitmasks, the same issue will be triggered in both the
16 and 32 bit count case.

This commit adds checks to bmp_read_info_header() rejecting BMP files
with "intentional" 0 bitmasks. These checks might be removed in the
future when proper handling of zero bitmasks will be available in
openjpeg2.

fixes #1057 (CVE-2018-5785)
</content>
</entry>
<entry>
<title>bmp_read_rle8_data(): avoid potential infinite loop (#996)</title>
<updated>2017-08-18T08:16:38Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2017-08-18T08:16:38Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=5597522cac96b1bc6d48a447751b1c6049248eef'/>
<id>urn:sha1:5597522cac96b1bc6d48a447751b1c6049248eef</id>
<content type='text'>
</content>
</entry>
<entry>
<title>bmp_read_info_header(): reject bmp files with biBitCount == 0 (#983)</title>
<updated>2017-08-14T15:26:58Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2017-08-14T15:26:58Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=baf0c1ad4572daa89caa3b12985bdd93530f0dd7'/>
<id>urn:sha1:baf0c1ad4572daa89caa3b12985bdd93530f0dd7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>imagetobmp: avoid shift by -1 (relates to #811)</title>
<updated>2017-08-09T07:42:30Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2017-08-09T07:42:30Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=5a560ebf5138ebc241e9962306ce74bfc50fc69c'/>
<id>urn:sha1:5a560ebf5138ebc241e9962306ce74bfc50fc69c</id>
<content type='text'>
</content>
</entry>
</feed>
