head 1.1; access; symbols; locks; strict; comment @ * @; 1.1 date 2026.06.30.20.07.32; author adam; state Exp; branches; next ; commitid 9cKu7YknkQaHqRLG; desc @@ 1.1 log @libjpeg-turbo: updated to 3.2.0 3.2.0 Fixed a regression introduced by 3.2 beta1[9] that broke Arm64EC Windows builds. Hardened the PNG writer (which is used by djpeg and tj3SaveImage*()) against applications that may erroneously attempt to write sample values that are out of range for the specified output data precision. This could have caused a buffer overrun in the PNG writer's rescale array if the output data precision was not 8 or 16 bits. The buffer overrun did not likely pose a security risk, since tj3SaveImage*() is not exposed to arbitrary external input data and since a caller that abused the API in the aforementioned manner could never work properly. Hardened the libjpeg API against hypothetical applications that may erroneously call jpeg_crop_scanline() with buffered-image mode and raw data output enabled. jpeg_crop_scanline() does not work with raw data output, but due to an oversight, it did not throw an error if both buffered-image mode and raw data output were enabled. If a hypothetical application aborted a normal decompression operation without reading any scanlines, started a new decompression operation using the same libjpeg instance with buffered-image mode and raw data output enabled, then called jpeg_crop_scanline() with arguments that would have caused any of the component planes to be cropped to a width of 1 sample, jpeg_crop_scanline() would have used freed memory. However, this did not likely pose a security risk, since an application that abused the API in the aforementioned manner could never work properly. Fixed a buffer overrun and subsequent segfault in jpegtran that occurred when attempting to use the -crop and -trim options to expand the width of an image narrower than one iMCU, discard partial iMCUs, and fill each block in the expanded region with the DC coefficient of the nearest block in the input image ("flatten.") Similarly, fixed an infinite loop that occurred when attempting to use the -crop and -trim options to expand the width of an image narrower than one iMCU, discard partial iMCUs, and fill the expanded region with repeated reflections of the input image ("reflect.") When the only iMCU column in the input image is partial and partial iMCUs are trimmed, the flatten and reflect extensions cannot work properly, so jpegtran now throws an error if that is the case. These issues were confined to the jpegtran application and thus did not pose a security risk. @ text @$NetBSD: patch-simd_arm__aarch32_jsimd.c,v 1.4 2026/03/27 10:48:22 adam Exp $ NetBSD support. --- simd/arm/aarch32/jsimdcpu.c.orig 2026-06-30 17:25:43.000000000 +0000 +++ simd/arm/aarch32/jsimdcpu.c @@@@ -27,6 +27,9 @@@@ #include "../../jsimdint.h" #include +#if defined(__NetBSD__) +#include +#endif #if !defined(__ARM_NEON__) && \ (defined(HAVE_GETAUXVAL) || defined(HAVE_ELF_AUX_INFO)) @@@@ -108,6 +111,9 @@@@ jpeg_simd_cpu_support(void) unsigned long cpufeatures = 0; #elif defined(__linux__) || defined(ANDROID) || defined(__ANDROID__) int bufsize = 1024; /* an initial guess for the line buffer size limit */ +#elif defined(__NetBSD__) + int neon_present; + size_t len; #endif #endif unsigned int simd_support = 0; @@@@ -127,6 +133,10 @@@@ jpeg_simd_cpu_support(void) if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT) break; } +#elif defined(__NetBSD__) + if (sysctlbyname("machdep.neon_present", &neon_present, &len, NULL, 0) == 0 + && neon_present != 0) + simd_support |= JSIMD_NEON; #elif defined(HAVE_ELF_AUX_INFO) elf_aux_info(AT_HWCAP, &cpufeatures, sizeof(cpufeatures)); if (cpufeatures & HWCAP_NEON) @