10 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
Dean 587bb343e8 Merge pull request #8106 from juanpimg/feat/prx-declare-ps5-3.20-exports
feat(prx): declare the missing PS5 3.20 system exports
2026-10-20 21:13:30 +13:00
juanpimg 2f0ed638dc feat(prx): declare the missing PS5 3.20 system exports
AnyPS5 resolves a title's imports by NID, so a title that imports a system
function no library provides fails to load with an unresolved import. The
PS5 3.20 export inventory lists 193 such exports across 37 PS5 system
libraries AnyPS5 implements but does not provide.

Declare them as throwing stubs so those titles load and reach their next
blocker. Each declaration calls NotImplemented_nid_no_patch and returns 0;
none of them implements the function. Declarations with a credible
prototype use it and cite the source with a pinned commit, and the rest
are declared without parameters, which resolves the import without making
an ABI claim. The technical-debt files record the limitation per library.

libSceMbus and libSceSystemService are left out because pull request #7821
declares them. libSceAgc is left out because its exports are versioned, so
the 3.20 NID names a different symbol from the one AnyPS5 ships.
libSceAvPlayer.native is left out because it compiles libSceAvPlayer's
Export.cpp.

Names and NIDs come from the PS5 3.20 export inventory at
https://github.com/DNNDHH/PS5-3.20_Libs/tree/b2a77c09cd71c01f34c790cfbe98c751a13262ad
2026-10-19 23:16:55 +02: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