Line 991:
Original code:
function writeAmf3ByteArray($d){$this->writeByte(0x0C);$this->writeAmf3String($d, true);$this->writeAmf3ByteArrayBody($d);}
change to:
function writeAmf3ByteArray($d){$this->writeByte(0x0C);$this->writeAmf3ByteArrayBody($d);}
It fixed two issues:
1. writeAmf3String and writeAmf3ByteArrayBody writes ByteArray body content twice
2. writeAmf3String uses U29S-ref, ByteArray should be U29O-ref ( ref AMF3-spec)
Hope helpful