Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase size caps in some places (animation size, geometry size etc.) #231

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

Yexeed
Copy link
Contributor

@Yexeed Yexeed commented May 29, 2024

Linked to the #230.

Outstanding cases that I have encountered so far:
BedrockCodecHelper_v419.java:49

** v_419 reading an image when reading an animation data (512kb)** 
Caused by: java.lang.IllegalArgumentException: Tried to read 524288 bytes but maximum is 65536
	at org.cloudburstmc.protocol.common.util.Preconditions.checkArgument(Preconditions.java:291) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.BaseBedrockCodecHelper.readByteArray(BaseBedrockCodecHelper.java:86) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v388.BedrockCodecHelper_v388.readImage(BedrockCodecHelper_v388.java:97) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v419.BedrockCodecHelper_v419.readAnimationData(BedrockCodecHelper_v419.java:49) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v568.BedrockCodecHelper_v568.lambda$readSkin$0(BedrockCodecHelper_v568.java:32) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.BaseBedrockCodecHelper.readArray(BaseBedrockCodecHelper.java:221) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.BaseBedrockCodecHelper.readArray(BaseBedrockCodecHelper.java:212) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v568.BedrockCodecHelper_v568.readSkin(BedrockCodecHelper_v568.java:32) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v390.serializer.PlayerListSerializer_v390.readEntryBase(PlayerListSerializer_v390.java:79) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v649.serializer.PlayerListSerializer_v649.readEntryBase(PlayerListSerializer_v649.java:22) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v390.serializer.PlayerListSerializer_v390.deserialize(PlayerListSerializer_v390.java:46) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v390.serializer.PlayerListSerializer_v390.deserialize(PlayerListSerializer_v390.java:14) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.BedrockCodec.tryDecode(BedrockCodec.java:68) ~[Waterdog.jar:?]
	... 89 more

BedrockCodecHelper_v419.java:49

** same, but another size (1 MB)
Caused by: java.lang.IllegalArgumentException: Tried to read 1048576 bytes but maximum is 65536
	at org.cloudburstmc.protocol.common.util.Preconditions.checkArgument(Preconditions.java:291) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.BaseBedrockCodecHelper.readByteArray(BaseBedrockCodecHelper.java:86) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v388.BedrockCodecHelper_v388.readImage(BedrockCodecHelper_v388.java:97) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v419.BedrockCodecHelper_v419.readAnimationData(BedrockCodecHelper_v419.java:49) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v568.BedrockCodecHelper_v568.lambda$readSkin$0(BedrockCodecHelper_v568.java:32) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.BaseBedrockCodecHelper.readArray(BaseBedrockCodecHelper.java:221) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.BaseBedrockCodecHelper.readArray(BaseBedrockCodecHelper.java:212) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v568.BedrockCodecHelper_v568.readSkin(BedrockCodecHelper_v568.java:32) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v390.serializer.PlayerListSerializer_v390.readEntryBase(PlayerListSerializer_v390.java:79) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v649.serializer.PlayerListSerializer_v649.readEntryBase(PlayerListSerializer_v649.java:22) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v390.serializer.PlayerListSerializer_v390.deserialize(PlayerListSerializer_v390.java:46) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v390.serializer.PlayerListSerializer_v390.deserialize(PlayerListSerializer_v390.java:14) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.BedrockCodec.tryDecode(BedrockCodec.java:68) ~[Waterdog.jar:?]
	... 92 more

BedrockCodecHelper_v568.java:35

Tried to read geometry data (2 MB, max was 1mb)
Caused by: java.lang.IllegalArgumentException: Tried to read 2180462 bytes but maximum is 1048576
	at org.cloudburstmc.protocol.common.util.Preconditions.checkArgument(Preconditions.java:291) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.BaseBedrockCodecHelper.readString(BaseBedrockCodecHelper.java:113) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v568.BedrockCodecHelper_v568.readSkin(BedrockCodecHelper_v568.java:35) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v390.serializer.PlayerListSerializer_v390.readEntryBase(PlayerListSerializer_v390.java:79) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v390.serializer.PlayerListSerializer_v390.deserialize(PlayerListSerializer_v390.java:46) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.v390.serializer.PlayerListSerializer_v390.deserialize(PlayerListSerializer_v390.java:14) ~[Waterdog.jar:?]
	at org.cloudburstmc.protocol.bedrock.codec.BedrockCodec.tryDecode(BedrockCodec.java:68) ~[Waterdog.jar:?]
	... 89 more

@Alemiz112 Alemiz112 self-requested a review May 29, 2024 15:11
Copy link
Member

@Alemiz112 Alemiz112 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants