hohav / peppi

Rust parser for Slippi SSBM replay files
MIT License
37 stars 9 forks source link

Panics due to invalid data #2

Closed ghost closed 4 years ago

ghost commented 4 years ago

Heya! I have some code that runs succesfully on about 99% of my replays. However, 1% of the replays give me the following errors:

[src/replay.rs:113] path = "/home/odd/downloads/replays/Game_20190324T121031.slp"
[src/replay.rs:114] e = Custom {
    kind: InvalidData,
    error: "expected: [85, 8, 109, 101, 116, 97, 100, 97, 116, 97, 123], got: [53, 109, 63, 128, 0, 0, 0, 0, 0, 0, 66]",
}
[src/replay.rs:113] path = "/home/odd/downloads/replays/Game_20190324T153815.slp"
[src/replay.rs:114] e = Custom {
    kind: InvalidData,
    error: "expected: [85, 8, 109, 101, 116, 97, 100, 97, 116, 97, 123], got: [53, 13, 54, 1, 161, 55, 0, 63, 56, 0, 37]",
}

The issue seems to be consistent across the different replays. I've uploaded the replays here: https://gofile.io/d/ofg8dO

hohav commented 4 years ago

Both of those files are truncated. You can tell by comparing them to normal replays, which will have a metadata block near the end. Replays are mostly binary, but the metadata block has enough ASCII that you can recognize it by opening the file in a hex editor or even Vim. You can also use the strings CLI tool: a normal replay will have stuff like metadata{U near the end.