Repository navigation
Conversation
Opening bytes that are not a well-formed .pixi crashed pixi at address 0x0. When no version of the data parsed, `loadFizzyZip` read the grid and layers from an `undefined` result. Fizzy's restart hand-over hit it by giving back an `art.pixi` its text editor had held. Reading the archive now lives in `src/fizzy_zip.zig`, which is std-only and checks everything: an archive that will not open, has no data entry, or holds data that is no version of the format is `error.FileLoadError`. So is a zero or oversized grid, no layers, a frame past the grid, or an fps of 0. A `.layer` entry must be exactly the canvas's pixels and a `.png` the canvas's size, where before a short one was read past its end. The selected layer is counted among the layers that loaded, and the zip's entry buffers are freed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
foxnne
force-pushed
the
document/malformed-pixi
branch
from
October 19, 2026 14:04
8b22ce8 to
22ec9b7
Compare
Contributor
Author
|
Closed by the maintainer's decision on 2026-10-21; the malformed .pixi guard is dropped for now. The branch stays. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opening bytes that are not a well-formed
.pixicrashed pixi with a segfault at0x0, inFile.loadFizzyZip. This was seen with 0.1.47 in a ReleaseFast fizzy, when the restart hand-over (KeptDocuments.openKept→loadDocumentFromBytes) gave back anart.pixithat fizzy's text editor had held.Cause. When
fizzydata.jsonwas missing or no version of the format parsed,extstayedundefined, and the loader went on to read its grid and itslayersslice. In ReleaseFast that slice's pointer is null.Fix. Reading the archive moves to
src/fizzy_zip.zig, which is std-only and tested byzig build test. Every malformed input iserror.FileLoadError:fizzydata.json/pixidata.json@intFromFloat(inf)before)In
loadFizzyZip:.layerentry must be exactly the canvas's pixels. A short one used to be read past its end..pnglayer must be the canvas's size.selected_layer_indexcounts only the layers that loaded. A skipped layer could leave it out of range.deiniton it.Tests (
src/fizzy_zip.zig): empty, 4 KiB of random bytes, text, a bare end record, and a lone local header. Alsoassets/src/misc.pixicut at about 512 points, a built archive cut at every byte, a corrupt central directory, a zip without a data entry, and malformed data of each kind above. The real file, and a v1 file withpixidata.json, still load.Verified (rebased onto main: Zig 0.17, SDK 0.2.32):
zig build testin Debug and ReleaseFast (14/14),zig build,zig fmt --check. The wasm target was not built locally. Not yet reproduced in a live fizzy restart.🤖 Generated with Claude Code