<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openjpeg/src/lib/openjp2/j2k.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>2023-12-08T15:47:34Z</updated>
<entry>
<title>Merge pull request #1490 from headshog/fix-j2k</title>
<updated>2023-12-08T15:47:34Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2023-12-08T15:47:34Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=49c4ef56129b85cce8aaad85e9f22f0f3bc16f2e'/>
<id>urn:sha1:49c4ef56129b85cce8aaad85e9f22f0f3bc16f2e</id>
<content type='text'>
Integer Overflow at j2k.c:3962</content>
</entry>
<entry>
<title>Merge pull request #1491 from headshog/fix-j2k-header</title>
<updated>2023-12-08T15:47:27Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2023-12-08T15:47:27Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=00e0bdc14f3feed681de19d46abb2cd8155f3f66'/>
<id>urn:sha1:00e0bdc14f3feed681de19d46abb2cd8155f3f66</id>
<content type='text'>
Integer Overflow at j2k.c:11114</content>
</entry>
<entry>
<title>fix j2k.c:11114</title>
<updated>2023-12-08T14:17:53Z</updated>
<author>
<name>headshog</name>
<email>craaaaaachind@gmail.com</email>
</author>
<published>2023-12-06T14:47:02Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=67e6a79bcf6b2ea5503f47954537d14ed37e4a72'/>
<id>urn:sha1:67e6a79bcf6b2ea5503f47954537d14ed37e4a72</id>
<content type='text'>
</content>
</entry>
<entry>
<title>opj_j2k_merge_ppm(): avoid unsigned-integer-overflow at j2k.c:3962 (#1490)</title>
<updated>2023-12-08T14:03:54Z</updated>
<author>
<name>headshog</name>
<email>craaaaaachind@gmail.com</email>
</author>
<published>2023-12-06T14:30:29Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=a817136f7edbd0e9d9ce46d1faf15506ed9478a0'/>
<id>urn:sha1:a817136f7edbd0e9d9ce46d1faf15506ed9478a0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>suppress warning during build using clang</title>
<updated>2023-12-08T11:56:37Z</updated>
<author>
<name>Tomoaki Teshima</name>
<email>tomoaki.teshima@gmail.com</email>
</author>
<published>2023-12-08T11:56:37Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=597389a45f63a7cd872859eacb267ea1bda64e9e'/>
<id>urn:sha1:597389a45f63a7cd872859eacb267ea1bda64e9e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix: use `opj_uint_ceildiv` instead of `opj_int_ceildiv` when necessary</title>
<updated>2023-09-23T10:50:57Z</updated>
<author>
<name>mayeut</name>
<email>mayeut@users.noreply.github.com</email>
</author>
<published>2023-09-23T09:02:54Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=d23e0284c9be174cc6daaa594c1139076771e16b'/>
<id>urn:sha1:d23e0284c9be174cc6daaa594c1139076771e16b</id>
<content type='text'>
There are a bunch of loc where we can see a usage of `opj_int_ceildiv`:
```
(OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)a, (OPJ_INT32)b);
```
where a &amp; b are `OPJ_UINT32`.

This can lead to overflow/underflow for some a/b combinations.
Replace those calls by `opj_uint_ceildiv` instead to always get a correct result.

This also allows some valid single tile images with huge tile size to be decoded properly.
Fix #1438
</content>
</entry>
<entry>
<title>Merge pull request #1462 from sebras/master</title>
<updated>2023-03-09T20:15:39Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2023-03-09T20:15:39Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=15c0dca5206d0101de2ce73b97138a2b26949011'/>
<id>urn:sha1:15c0dca5206d0101de2ce73b97138a2b26949011</id>
<content type='text'>
CMake: error out on warnings for strict/missing prototypes.</content>
</entry>
<entry>
<title>CMake: error out on warnings for strict/missing prototypes.</title>
<updated>2023-03-09T19:09:27Z</updated>
<author>
<name>Sebastian Rasmussen</name>
<email>sebras@gmail.com</email>
</author>
<published>2023-03-09T18:20:58Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=eb8a7e44279415fdefda6d980b99bd7e00c41da0'/>
<id>urn:sha1:eb8a7e44279415fdefda6d980b99bd7e00c41da0</id>
<content type='text'>
And fix strict-prototypes/missing-prototypes warnings.
</content>
</entry>
<entry>
<title>openjp2/j2k: replace sprintf calls with snprintf</title>
<updated>2023-03-07T15:47:10Z</updated>
<author>
<name>Mark Mentovai</name>
<email>mark@chromium.org</email>
</author>
<published>2022-11-07T14:32:02Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=032b6e93cb38b42c365ebd5296ac08ccf5163feb'/>
<id>urn:sha1:032b6e93cb38b42c365ebd5296ac08ccf5163feb</id>
<content type='text'>
This makes it possible to build j2k.c without warnings using the macOS
13 SDK. Calls to sprintf are replaced with snprintf, passing appropriate
buffer sizes.

It doesn’t appear that any of the changed uses of sprintf were actually
unsafe, so no behavior change is expected aside from SDK compatibility.

The macOS 13 SDK deprecates sprintf as it’s difficult to use safely. The
deprecation warning message is visible when building C++, but it is not
normally visible when building plain C code due to a quirk in how
sprintf is declared in the SDK. However, the deprecation message is
visible when building plain C under Address Sanitizer
(-fsanitize=address). This discrepancy was discovered at
https://crbug.com/1381706 and reported to Apple with a copy at
https://openradar.appspot.com/FB11761475.

The macOS 13 SDK is packaged in Xcode 14.1, released on 2022-11-01. This
also affects the iOS 16 SDK and other 2022-era Apple OS SDKs packaged in
Xcode 14.0, released on 2022-09-12.

j2k.c is visible to the Chromium build via PDFium, and this change is
needed to allow Chromium to move forward to the macOS 13 SDK.

This change is limited to src/lib/openjp2. Other uses of sprintf were
found throughout openjpeg.
</content>
</entry>
<entry>
<title>Cleanup code related to quality layer allocation, and add a few safety checks</title>
<updated>2022-08-11T16:12:07Z</updated>
<author>
<name>Even Rouault</name>
<email>even.rouault@spatialys.com</email>
</author>
<published>2022-08-11T16:06:21Z</published>
<link rel='alternate' type='text/html' href='https://git.carlh.net/cgit/openjpeg/commit/?id=c06632c6f6d0a3e106374fe462869b131366c2d0'/>
<id>urn:sha1:c06632c6f6d0a3e106374fe462869b131366c2d0</id>
<content type='text'>
</content>
</entry>
</feed>
