libjpeg-turbo: updated to 2.1.5 Significant changes relative to 2.1.4 Fixed issues in the build system whereby, when using the Ninja Multi-Config CMake generator, a static build of libjpeg-turbo (a build in which ENABLE_SHARED is 0) could not be installed, a Windows installer could not be built, and the Java regression tests failed. Fixed a regression introduced by 2.0 beta1[15] that caused a buffer overrun in the progressive Huffman encoder when attempting to transform a specially-crafted malformed 12-bit-per-component JPEG image into a progressive 12-bit-per-component JPEG image using a 12-bit-per-component build of libjpeg-turbo (-DWITH_12BIT=1.) Given that the buffer overrun was fully contained within the progressive Huffman encoder structure and did not cause a segfault or other user-visible errant behavior, given that the lossless transformer (unlike the decompressor) is not generally exposed to arbitrary data exploits, and given that 12-bit-per-component builds of libjpeg-turbo are uncommon, this issue did not likely pose a security risk. Fixed an issue whereby, when using a 12-bit-per-component build of libjpeg-turbo (-DWITH_12BIT=1), passing samples with values greater than 4095 or less than 0 to jpeg_write_scanlines() caused a buffer overrun or underrun in the RGB-to-YCbCr color converter. Fixed a floating point exception that occurred when attempting to use the jpegtran -drop and -trim options to losslessly transform a specially-crafted malformed JPEG image. Fixed an issue in tjBufSizeYUV2() whereby it returned a bogus result, rather than throwing an error, if the align parameter was not a power of 2. Fixed a similar issue in tjCompressFromYUV() whereby it generated a corrupt JPEG image in certain cases, rather than throwing an error, if the align parameter was not a power of 2. Fixed an issue whereby tjDecompressToYUV2(), which is a wrapper for tjDecompressToYUVPlanes(), used the desired YUV image dimensions rather than the actual scaled image dimensions when computing the plane pointers and strides to pass to tjDecompressToYUVPlanes(). This caused a buffer overrun and subsequent segfault if the desired image dimensions exceeded the scaled image dimensions. Fixed an issue whereby, when decompressing a 12-bit-per-component JPEG image (-DWITH_12BIT=1) using an alpha-enabled output color space such as JCS_EXT_RGBA, the alpha channel was set to 255 rather than 4095. Fixed an issue whereby the Java version of TJBench did not accept a range of quality values. Fixed an issue whereby, when -progressive was passed to TJBench, the JPEG input image was not transformed into a progressive JPEG image prior to decompression.diff -r1.28 -r1.29 pkgsrc/graphics/libjpeg-turbo/Makefile
(adam)
@@ -1,16 +1,16 @@ | @@ -1,16 +1,16 @@ | |||
1 | # $NetBSD: Makefile,v 1.28 2023/01/24 18:36:27 wiz Exp $ | 1 | # $NetBSD: Makefile,v 1.29 2023/02/01 12:39:30 adam Exp $ | |
2 | 2 | |||
3 | DISTNAME= libjpeg-turbo-2.1.4 | 3 | DISTNAME= libjpeg-turbo-2.1.5 | |
4 | CATEGORIES= graphics | 4 | CATEGORIES= graphics | |
5 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=libjpeg-turbo/} | 5 | MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=libjpeg-turbo/} | |
6 | 6 | |||
7 | MAINTAINER= dsainty@NetBSD.org | 7 | MAINTAINER= dsainty@NetBSD.org | |
8 | HOMEPAGE= https://libjpeg-turbo.org/ | 8 | HOMEPAGE= https://libjpeg-turbo.org/ | |
9 | COMMENT= Accelerated libjpeg with SIMD instructions | 9 | COMMENT= Accelerated libjpeg with SIMD instructions | |
10 | LICENSE= gnu-lgpl-v2 AND ijg # OR wxWindows Library Licence, Version 3.1 | 10 | LICENSE= gnu-lgpl-v2 AND ijg # OR wxWindows Library Licence, Version 3.1 | |
11 | 11 | |||
12 | # Note also that libjpeg-turbo's library has a different major version | 12 | # Note also that libjpeg-turbo's library has a different major version | |
13 | # number (8) than that installed by the jpeg package (9). | 13 | # number (8) than that installed by the jpeg package (9). | |
14 | # https://libjpeg-turbo.org/About/Jpeg-9 | 14 | # https://libjpeg-turbo.org/About/Jpeg-9 | |
15 | CONFLICTS= jpeg-[0-9]* | 15 | CONFLICTS= jpeg-[0-9]* | |
16 | 16 |
@@ -1,8 +1,8 @@ | @@ -1,8 +1,8 @@ | |||
1 | $NetBSD: distinfo,v 1.23 2022/08/14 20:57:40 adam Exp $ | 1 | $NetBSD: distinfo,v 1.24 2023/02/01 12:39:30 adam Exp $ | |
2 | 2 | |||
3 | BLAKE2s (libjpeg-turbo-2.1.4.tar.gz) = 2c9813bdf0f93af4a797d674f3080017dd8501793d69ef50b64d9fb627646ef9 | 3 | BLAKE2s (libjpeg-turbo-2.1.5.tar.gz) = 0bb558238a3e9cbcc91e5a35027e90c2f868ca3e388bad2826403c38269675cb | |
4 | SHA512 (libjpeg-turbo-2.1.4.tar.gz) = 511f065767c022da06b6c36299686fa44f83441646f7e33b766c6cfab03f91b0e6bfa456962184071dadaed4057ba9a29cba685383f3eb86a4370a1a53731a70 | 4 | SHA512 (libjpeg-turbo-2.1.5.tar.gz) = ceab6d1c3c46d2816b06402e3b912e950d887fc8a6fb32fa6876f4aaa663b4769d8f4c50e1b967addf6704d0760ca14ed723d55e0312d7ca69e7f2a91484c0dc | |
5 | Size (libjpeg-turbo-2.1.4.tar.gz) = 2261822 bytes | 5 | Size (libjpeg-turbo-2.1.5.tar.gz) = 2264471 bytes | |
6 | SHA1 (patch-jpeglib.h) = 22f69b5fed1882c33f4a8a6e42b8aca5ed195de3 | 6 | SHA1 (patch-jpeglib.h) = 22f69b5fed1882c33f4a8a6e42b8aca5ed195de3 | |
7 | SHA1 (patch-simd_arm__aarch32_jsimd.c) = 1176982b19289e7f664d078a31f7c470e453ed51 | 7 | SHA1 (patch-simd_arm__aarch32_jsimd.c) = 0d35d6f0727709d4e894202a3a297fc66383c377 | |
8 | SHA1 (patch-simd_arm__aarch64_jsimd.c) = 0e8fac36a9abc70e8526370237c7cdd28be519ef | 8 | SHA1 (patch-simd_arm__aarch64_jsimd.c) = 76c5e81403f70a8ea8bca8ae2266066fff5ec6f9 |
@@ -1,36 +1,37 @@ | @@ -1,36 +1,37 @@ | |||
1 | $NetBSD: patch-simd_arm__aarch32_jsimd.c,v 1.2 2022/08/14 20:57:40 adam Exp $ | 1 | $NetBSD: patch-simd_arm__aarch32_jsimd.c,v 1.3 2023/02/01 12:39:30 adam Exp $ | |
2 | 2 | |||
3 | --- simd/arm/aarch32/jsimd.c.orig 2022-08-08 21:03:55.000000000 +0000 | 3 | NetBSD support. | |
4 | ||||
5 | --- simd/arm/aarch32/jsimd.c.orig 2023-01-28 00:24:41.000000000 +0000 | |||
4 | +++ simd/arm/aarch32/jsimd.c | 6 | +++ simd/arm/aarch32/jsimd.c | |
5 | @@ -27,6 +27,10 @@ | 7 | @@ -26,6 +26,9 @@ | |
8 | #include "../../jsimd.h" | |||
6 | 9 | |||
7 | #include <ctype.h> | 10 | #include <ctype.h> | |
8 | ||||
9 | +#if defined(__NetBSD__) | 11 | +#if defined(__NetBSD__) | |
10 | +#include <sys/sysctl.h> | 12 | +#include <sys/sysctl.h> | |
11 | +#endif | 13 | +#endif | |
12 | + | |||
13 | static unsigned int simd_support = ~0; | |||
14 | static unsigned int simd_huffman = 1; | |||
15 | 14 | |||
16 | @@ -107,6 +111,9 @@ init_simd(void) | 15 | static THREAD_LOCAL unsigned int simd_support = ~0; | |
16 | static THREAD_LOCAL unsigned int simd_huffman = 1; | |||
17 | @@ -105,6 +108,9 @@ init_simd(void) | |||
17 | #endif | 18 | #endif | |
18 | #if !defined(__ARM_NEON__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)) | 19 | #if !defined(__ARM_NEON__) && (defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)) | |
19 | int bufsize = 1024; /* an initial guess for the line buffer size limit */ | 20 | int bufsize = 1024; /* an initial guess for the line buffer size limit */ | |
20 | +#elif defined(__NetBSD__) | 21 | +#elif defined(__NetBSD__) | |
21 | + int neon_present; | 22 | + int neon_present; | |
22 | + size_t len; | 23 | + size_t len; | |
23 | #endif | 24 | #endif | |
24 | 25 | |||
25 | if (simd_support != ~0U) | 26 | if (simd_support != ~0U) | |
26 | @@ -125,6 +132,10 @@ init_simd(void) | 27 | @@ -123,6 +129,10 @@ init_simd(void) | |
27 | if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT) | 28 | if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT) | |
28 | break; | 29 | break; | |
29 | } | 30 | } | |
30 | +#elif defined(__NetBSD__) | 31 | +#elif defined(__NetBSD__) | |
31 | + if (sysctlbyname("machdep.neon_present", &neon_present, &len, NULL, 0) == 0 | 32 | + if (sysctlbyname("machdep.neon_present", &neon_present, &len, NULL, 0) == 0 | |
32 | + && neon_present != 0) | 33 | + && neon_present != 0) | |
33 | + simd_support |= JSIMD_NEON; | 34 | + simd_support |= JSIMD_NEON; | |
34 | #endif | 35 | #endif | |
35 | 36 | |||
36 | #ifndef NO_GETENV | 37 | #ifndef NO_GETENV |
@@ -1,36 +1,37 @@ | @@ -1,36 +1,37 @@ | |||
1 | $NetBSD: patch-simd_arm__aarch64_jsimd.c,v 1.1 2021/04/26 08:18:48 adam Exp $ | 1 | $NetBSD: patch-simd_arm__aarch64_jsimd.c,v 1.2 2023/02/01 12:39:30 adam Exp $ | |
2 | 2 | |||
3 | --- simd/arm/aarch64/jsimd.c.orig 2021-04-23 16:42:40.000000000 +0000 | 3 | NetBSD support. | |
4 | ||||
5 | --- simd/arm/aarch64/jsimd.c.orig 2023-01-28 00:24:41.000000000 +0000 | |||
4 | +++ simd/arm/aarch64/jsimd.c | 6 | +++ simd/arm/aarch64/jsimd.c | |
5 | @@ -33,6 +33,10 @@ | 7 | @@ -25,6 +25,9 @@ | |
6 | #define JSIMD_FASTST3 2 | 8 | #include "../../jsimd.h" | |
7 | #define JSIMD_FASTTBL 4 | |||
8 | 9 | |||
10 | #include <ctype.h> | |||
9 | +#if defined(__NetBSD__) | 11 | +#if defined(__NetBSD__) | |
10 | +#include <sys/sysctl.h> | 12 | +#include <sys/sysctl.h> | |
11 | +#endif | 13 | +#endif | |
12 | + | 14 | ||
13 | static unsigned int simd_support = ~0; | 15 | #define JSIMD_FASTLD3 1 | |
14 | static unsigned int simd_huffman = 1; | 16 | #define JSIMD_FASTST3 2 | |
15 | static unsigned int simd_features = JSIMD_FASTLD3 | JSIMD_FASTST3 | | 17 | @@ -124,6 +127,9 @@ init_simd(void) | |
16 | @@ -129,6 +133,9 @@ init_simd(void) | |||
17 | #endif | 18 | #endif | |
18 | #if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) | 19 | #if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) | |
19 | int bufsize = 1024; /* an initial guess for the line buffer size limit */ | 20 | int bufsize = 1024; /* an initial guess for the line buffer size limit */ | |
20 | +#elif defined(__NetBSD__) | 21 | +#elif defined(__NetBSD__) | |
21 | + int neon_present; | 22 | + int neon_present; | |
22 | + size_t len; | 23 | + size_t len; | |
23 | #endif | 24 | #endif | |
24 | 25 | |||
25 | if (simd_support != ~0U) | 26 | if (simd_support != ~0U) | |
26 | @@ -143,6 +150,10 @@ init_simd(void) | 27 | @@ -138,6 +144,10 @@ init_simd(void) | |
27 | if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT) | 28 | if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT) | |
28 | break; | 29 | break; | |
29 | } | 30 | } | |
30 | +#elif defined(__NetBSD__) | 31 | +#elif defined(__NetBSD__) | |
31 | + if (sysctlbyname("machdep.neon_present", &neon_present, &len, NULL, 0) == 0 | 32 | + if (sysctlbyname("machdep.neon_present", &neon_present, &len, NULL, 0) == 0 | |
32 | + && neon_present != 0) | 33 | + && neon_present != 0) | |
33 | + simd_support |= JSIMD_NEON; | 34 | + simd_support |= JSIMD_NEON; | |
34 | #endif | 35 | #endif | |
35 | 36 | |||
36 | #ifndef NO_GETENV | 37 | #ifndef NO_GETENV |