8 Commits
Author SHA1 Message Date
boykopovar d0417623a7 fix(jpegdec): enforce component row buffer capacity 2026-10-21 21:52:25 +03:00
boykopovar c3eba45600 fix(jpegdec): recover image metadata and coefficient requirements 2026-10-21 21:52:24 +03:00
boykopovar a058d8d8fa fix(jpegdec): enforce native decode parameter limits 2026-10-21 21:52:23 +03:00
boykopovar 65f686c336 fix(jpegdec): restore error codes and work memory contract 2026-10-21 21:52:23 +03:00
al3w0f205 8ea3b5cab5 fix(libSceJpegDec): reject misaligned output buffers and oversized alpha values 2026-10-20 07:12:43 -05:00
Federico Marras d65c969df8 feat(libSceJpegDec): decode with a down scale of 2, 4 or 8
sceJpegDecParseHeader and sceJpegDecDecode threw for every down scale
other than 1. SharpProspero's JpegDec.cs documents the factors 1, 2, 4
and 8 and output dimensions that account for the down scale.

Decoder::Jpeg gains DecodeScaled, which decodes through libjpeg-turbo's
scaled inverse DCT, and ScaledDimension, its rounded-up output size.
sceJpegDecParseHeader reports the scaled output size; sceJpegDecDecode
checks the pitch and image buffer against it, writes the scaled image
and packs the output size into its result. A down scale of 1 still
decodes as before. Decode modes other than 0, other down scales and a
down-scaled CMYK or YCCK image still throw.
2026-10-19 18:57:12 +02:00
RickandClaude Opus 5.5 95e51985d4 fix(libSceJpegDec): use the JpegDec parameter and image info layouts
The JpegDec structures were libScePngDec's under new names. OpenOrbis
jpeg.h and SharpProspero JpegDec.cs agree on a 12-byte create param, a
0x30-byte decode param with a coefficient buffer, decode mode and down
scale, and a 0x24-byte image info that reports the coefficient memory
size, the suitable CSC attribute and the output size.

Accept the CSC attributes 1 and 2 that SharpProspero passes, fill the
output size, component count, coefficient memory size and suitable
attribute, apply the requested alpha, and throw for decode modes other
than 0 and down scales other than 1.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 16:44:09 +02:00
Pouare514 8bd9670ab0 feat(libSceJpegDec): implement JPEG decoding 2026-10-02 13:34:41 +02:00