Commit Graph
6 Commits
Author SHA1 Message Date
hypermoistandClaude Sonnet 5.5 abd3ca8112 test(libSceJpegDec): drop the callback-reentry throw assertion
The nested decode from an input callback is an unimplemented path whose
console behaviour is unknown, so the test no longer requires it to throw.
The production guard stays.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-02 01:20:08 +13:00
hypermoistandClaude Opus 5.5 aeb2346bb8 fix(libSceJpegDec): keep an input stream alive for the call reading it
parseStream and decodeStream held a reference into the stream map
outside streamMutex while the guest's input callback ran. A callback
that deleted the handle, or a delete or new parse on another thread,
erased the stream under the running call.

- The map holds shared streams; each call keeps its own stream until
  it returns, and the callback still runs outside streamMutex.
- A call that reaches a stream another call is still reading throws,
  as the console's answer is not known; the debt entry says so.
- Tests: deleting the handle from the callback during a parse and
  during a decode, and a decode re-entered from the callback.
- The test no longer requires parse operation 0x11 to throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 23:03:57 +13:00
hypermoist b035153876 fix(libSceJpegDec): return 0x80650012 on malformed input-control parse
Match PS5 firmware 13.42 module behavior by returning 0x80650012
(DECODE_ERROR) rather than 0x80650010 when input-control parse ends
before the frame header or encounters malformed marker data. Drop
the throw assertions for unsupported down scale and missing header
decodes in GuestJpegDecInputControl.cpp as requested in review.

Assisted-by: Antigravity:gemini-3.8-flash
2026-10-27 18:51:31 +13:00
hypermistandClaude Opus 5.5 ffacd70618 refactor(libSceJpegDec): declare sceJpegDecDecodeWithInputControl in the library header
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 13:29:09 +13:00
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