Commit Graph
2 Commits
Author SHA1 Message Date
hypermistandClaude Opus 5.5 e7d5de2ed7 fix(libSceJpegDec): stop parsing a stream that can no longer form a frame header
The parse phase kept asking the callback for input until it ended. It now stops once the buffered bytes do not start with SOI, reach EOI or break the marker structure before a frame header, so a source that never ends cannot loop. The debt entry also notes that a stream stays in host memory when the work memory is freed without sceJpegDecDelete.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SNqSvnFwRBz3D76n476yw6
2026-10-23 04:08:05 +13:00
hypermistandClaude Opus 5.5 30b12ab173 feat(libSceJpegDec): stream JPEG input through a callback in sceJpegDecDecodeWithInputControl
The export takes the decoder handle, a 0x38-byte parameter block and an
image-info pointer. The block starts with an input callback and its
argument; the callback fills a {data, size} chunk and a negative result
or an empty chunk ends the input. Operation 0x10 parses the header and
fills the image info, and 0x20 continues the same stream, with a new
callback if given, and decodes into the image buffer. Bit 0 is the
decode mode. The decode checks match sceJpegDecDecode's and run before
any more input is read, and the result is the packed output size.

Both phases run through the same header, image-info and decode steps as
the memory-based calls, so the decode path is shared with
sceJpegDecDecode: its target checks and image writing move into helpers.

Read from libSceJpegDec.sprx, firmware 12.00, not measured on a console.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SNqSvnFwRBz3D76n476yw6
2026-10-23 02:05:18 +13:00