mirror of
https://github.com/openwrt/packages.git
synced 2026-05-31 06:51:51 +08:00
ad6f76e309
Security fixes (18 GHSAs addressed between 7.1.2-1 and 7.1.2-21): - Fix stack buffer overflow in MagnifyImage (GHSA-rqq8-jh93-f4vg, high) - Fix heap buffer overflow in WaveletDenoiseImage (GHSA-5ggv-92r5-cp4p) - Fix uninitialized pointer dereference in JBIG decoder (GHSA-wj8w-pjxf-9g4f, high) - Fix heap buffer over-write in PNG encoder with large profiles (GHSA-qmw5-2p58-xvrc) - Fix heap buffer overflow in UHDR encoder (GHSA-h95r-c8c7-mrwx) - Fix stack buffer overflow in sixel encoder (GHSA-49hx-7656-jpg3) - Fix heap-buffer-overflow in NewXMLTree XML parsing (GHSA-gc62-2v5p-qpmp) - Fix heap buffer over-write on 32-bit systems in SFW decoder (GHSA-56jp-jfqg-f8f4) - Add overflow checks to BMP/DIB, SGI, PS3, JXL, and sixel write paths Bug fixes: - Fix double-free in SVG gradientTransform/transform parsing - Fix NULL pointer dereference in HEIC NCLX color profile allocation - Fix heap over-read in BilateralBlurImage with even-dimension kernels - Fix infinite loop when decoding JXL with -limit height/width - Fix race condition using properties instead of global splaytree Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
51 lines
1.7 KiB
Bash
51 lines
1.7 KiB
Bash
#!/bin/sh
|
|
|
|
# $2 is PKG_VERSION which uses dots: e.g. "7.1.2.21"
|
|
# convert --version reports with a dash: "7.1.2-21"
|
|
# Build the dash form for grep.
|
|
_imver=$(echo "$2" | sed 's/\.\([0-9]*\)$/-\1/')
|
|
|
|
case "$1" in
|
|
imagemagick)
|
|
# Version check; convert and magick are both installed
|
|
convert --version | grep -F "ImageMagick"
|
|
convert --version | grep -F "$_imver"
|
|
|
|
# Create a test image via the ImageMagick convert command
|
|
convert -size 32x32 xc:white /tmp/im-white.png
|
|
[ -f /tmp/im-white.png ] || { echo "FAIL: PNG creation"; exit 1; }
|
|
|
|
# Identify: confirm format and geometry
|
|
identify /tmp/im-white.png | grep -E "PNG.*32x32"
|
|
|
|
# Convert to JPEG
|
|
convert /tmp/im-white.png /tmp/im-white.jpg
|
|
identify /tmp/im-white.jpg | grep "JPEG"
|
|
|
|
# Resize: exact geometry
|
|
convert -size 64x64 xc:blue -resize 16x16! /tmp/im-small.png
|
|
identify /tmp/im-small.png | grep -E "PNG.*16x16"
|
|
|
|
# Color sampling: create a known red pixel, read it back
|
|
convert -size 1x1 xc:'rgb(255,0,0)' /tmp/im-red.png
|
|
# fx/info: query exercises the pixel engine
|
|
convert /tmp/im-red.png -format '%[fx:p{0,0}.r*255]' info: | grep -E "^255$"
|
|
|
|
# BMP round-trip (exercises a different codec path)
|
|
convert /tmp/im-white.png /tmp/im-white.bmp
|
|
identify /tmp/im-white.bmp | grep "BMP"
|
|
|
|
# Grayscale conversion
|
|
convert /tmp/im-red.png -colorspace Gray /tmp/im-gray.png
|
|
identify -verbose /tmp/im-gray.png | grep -i "gray"
|
|
|
|
# Composite two images (exercises MagickCore composite engine)
|
|
convert /tmp/im-white.png /tmp/im-red.png \
|
|
-gravity Center -composite /tmp/im-comp.png
|
|
identify /tmp/im-comp.png | grep "PNG"
|
|
|
|
rm -f /tmp/im-white.png /tmp/im-white.jpg /tmp/im-small.png \
|
|
/tmp/im-red.png /tmp/im-white.bmp /tmp/im-gray.png /tmp/im-comp.png
|
|
;;
|
|
esac
|