You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BufferUnderflowException occurres when attempting to decode RTMP message which uses a marker signaling a switch from AMF0 to AMF3.
Have tested against the following versions:
1.0.8-M13
1.0.9-RELEASE
1.0.10-M6
Stack Trace
java.nio.BufferUnderflowException
at java.nio.Buffer.nextGetIndex(Buffer.java:500)
at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:135)
at org.apache.mina.core.buffer.AbstractIoBuffer.get(AbstractIoBuffer.java:501)
at org.red5.io.amf.Input.readBoolean(Input.java:167)
at org.red5.io.object.Deserializer.deserialize(Deserializer.java:93)
at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.handleParameters(RTMPProtocolDecoder.java:1136)
at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.decodeAction(RTMPProtocolDecoder.java:779)
at org.red5.server.net.rtmp.codec.RTMPProtocolDecoder.decodeMessage(RTMPProtocolDecoder.java:524)
at solers.sockpuppet.Red5ClientIT.testDecodeMessage(Red5ClientIT.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
importjava.nio.ByteBuffer;
importorg.apache.commons.codec.DecoderException;
importorg.apache.commons.codec.binary.Hex;
importorg.apache.mina.core.buffer.IoBuffer;
importorg.apache.mina.core.buffer.SimpleBufferAllocator;
importorg.easymock.EasyMock;
importorg.junit.Test;
importorg.red5.server.api.IConnection;
importorg.red5.server.net.rtmp.RTMPConnection;
importorg.red5.server.net.rtmp.codec.RTMPProtocolDecoder;
importorg.red5.server.net.rtmp.message.Constants;
importorg.red5.server.net.rtmp.message.Header;
publicclassRed5ClientTest {
@TestpublicvoidtestDecodeMessage() throwsDecoderException {
//Mocking out the connectionRTMPConnectionconn = EasyMock.createNiceMock(RTMPConnection.class);
EasyMock.expect(conn.getEncoding()).andStubReturn(IConnection.Encoding.AMF0);
EasyMock.replay(conn);
//Setting up the headerHeaderheader = newHeader();
header.setDataType(Constants.TYPE_INVOKE);
//Defining the RMTP AMF0 body that is causing the issuebyte[] _resultPacket = Hex.decodeHex("0200075F726573756C74004000000000000000051101".toCharArray());
ByteBufferbyteBuffer = ByteBuffer.wrap(_resultPacket);
IoBufferioBuffer = newSimpleBufferAllocator().wrap(byteBuffer);
//Attempting to decode the body, but will result in stack traceRTMPProtocolDecoderdecoder = newRTMPProtocolDecoder();
decoder.decodeMessage(conn, header, ioBuffer);
}
}
Wireshark Packet Capture ScreenShot
The text was updated successfully, but these errors were encountered:
BufferUnderflowException occurres when attempting to decode RTMP message which uses a marker signaling a switch from AMF0 to AMF3.
Have tested against the following versions:
Stack Trace
Log
Unit Test
Wireshark Packet Capture ScreenShot
The text was updated successfully, but these errors were encountered: