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

Skin sizes got larger? Failing to decode animation image because maxSize cap. #230

Open
Yexeed opened this issue May 26, 2024 · 1 comment

Comments

@Yexeed
Copy link
Contributor

Yexeed commented May 26, 2024

Having this problem for around 2+ months. The decoder fails when trying to decode skin animation image with 128 * 128 * 4 cap, while the actual skin is having a 256 * 128 * 4 animation image size 🤔
Running on [email protected] release

org.cloudburstmc.protocol.bedrock.codec.PacketSerializeException: Error whilst deserializing PlayerListPacket(entries=SENSITIVE, action=ADD)
	at org.cloudburstmc.protocol.bedrock.codec.BedrockCodec.tryDecode(BedrockCodec.java:70) ~[Waterdog.jar:?]
	at dev.waterdog.waterdogpe.network.protocol.handler.ProxyBatchBridge.decodePacket(ProxyBatchBridge.java:92) ~[Waterdog.jar:?]
	at dev.waterdog.waterdogpe.network.protocol.handler.ProxyBatchBridge.onBedrockBatch(ProxyBatchBridge.java:56) ~[Waterdog.jar:?]
	at dev.waterdog.waterdogpe.network.connection.client.BedrockClientConnection.channelRead0(BedrockClientConnection.java:87) ~[Waterdog.jar:?]
	at dev.waterdog.waterdogpe.network.connection.client.BedrockClientConnection.channelRead0(BedrockClientConnection.java:57) ~[Waterdog.jar:?]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[Waterdog.jar:?]
	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[Waterdog.jar:?]
	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[Waterdog.jar:?]
	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[Waterdog.jar:?]
	at org.cloudburstmc.netty.handler.codec.raknet.ProxyInboundRouter.channelRead(ProxyInboundRouter.java:66) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at org.cloudburstmc.netty.handler.codec.raknet.common.EncapsulatedToMessageHandler.channelRead0(EncapsulatedToMessageHandler.java:15) ~[Waterdog.jar:?]
	at org.cloudburstmc.netty.handler.codec.raknet.common.EncapsulatedToMessageHandler.channelRead0(EncapsulatedToMessageHandler.java:8) ~[Waterdog.jar:?]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at org.cloudburstmc.netty.handler.codec.raknet.AdvancedChannelInboundHandler.channelRead(AdvancedChannelInboundHandler.java:48) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at org.cloudburstmc.netty.handler.codec.raknet.AdvancedChannelInboundHandler.channelRead(AdvancedChannelInboundHandler.java:48) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at org.cloudburstmc.netty.handler.codec.raknet.AdvancedChannelInboundHandler.channelRead(AdvancedChannelInboundHandler.java:48) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at org.cloudburstmc.netty.handler.codec.raknet.common.RakSessionCodec.onOrderedReceived(RakSessionCodec.java:353) ~[Waterdog.jar:?]
	at org.cloudburstmc.netty.handler.codec.raknet.common.RakSessionCodec.checkForOrdered(RakSessionCodec.java:334) ~[Waterdog.jar:?]
	at org.cloudburstmc.netty.handler.codec.raknet.common.RakSessionCodec.handleDatagram(RakSessionCodec.java:322) ~[Waterdog.jar:?]
	at org.cloudburstmc.netty.handler.codec.raknet.common.RakSessionCodec.channelRead(RakSessionCodec.java:218) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:102) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[Waterdog.jar:?]
	at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at org.cloudburstmc.netty.handler.codec.raknet.AdvancedChannelInboundHandler.channelRead(AdvancedChannelInboundHandler.java:48) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at org.cloudburstmc.netty.handler.codec.raknet.client.RakClientProxyRouteHandler.channelRead(RakClientProxyRouteHandler.java:50) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterdog.jar:?]
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[Waterdog.jar:?]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterdog.jar:?]
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[Waterdog.jar:?]
	at io.netty.channel.epoll.EpollDatagramChannel.connectedRead(EpollDatagramChannel.java:606) ~[Waterdog.jar:?]
	at io.netty.channel.epoll.EpollDatagramChannel.access$400(EpollDatagramChannel.java:56) ~[Waterdog.jar:?]
	at io.netty.channel.epoll.EpollDatagramChannel$EpollDatagramChannelUnsafe.epollInReady(EpollDatagramChannel.java:538) ~[Waterdog.jar:?]
	at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:499) ~[Waterdog.jar:?]
	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:397) ~[Waterdog.jar:?]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[Waterdog.jar:?]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[Waterdog.jar:?]
	at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.IllegalArgumentException: Tried to read 131072 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```
@CoolLoong
Copy link
Contributor

https://github.com/PowerNukkitX/WaterdogPE-PNX

you can refer to the change in this project to resolve

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

No branches or pull requests

2 participants