----------------------------------------------------------------------------
| 1722 | |
| 1723 | //---------------------------------------------------------------------------- |
| 1724 | unsigned char* vtkClientServerStream::ParseArray( |
| 1725 | int order, unsigned char* data, unsigned char* end, unsigned int wordSize) |
| 1726 | { |
| 1727 | // Read the array length. |
| 1728 | vtkTypeUInt32 length; |
| 1729 | if (data > end - sizeof(length)) |
| 1730 | { |
| 1731 | /* ERROR */ |
| 1732 | return nullptr; |
| 1733 | } |
| 1734 | this->PerformByteSwap(order, data, 1, sizeof(length)); |
| 1735 | memcpy(&length, data, sizeof(length)); |
| 1736 | data += sizeof(length); |
| 1737 | |
| 1738 | // Calculate the size of the array data. |
| 1739 | vtkTypeUInt32 size = length * wordSize; |
| 1740 | |
| 1741 | // Byte-swap the array data. |
| 1742 | if (data > end - size) |
| 1743 | { |
| 1744 | /* ERROR */ |
| 1745 | return nullptr; |
| 1746 | } |
| 1747 | this->PerformByteSwap(order, data, length, wordSize); |
| 1748 | |
| 1749 | // Return the position after the array. |
| 1750 | return data + size; |
| 1751 | } |
| 1752 | |
| 1753 | //---------------------------------------------------------------------------- |
| 1754 | unsigned char* vtkClientServerStream::ParseString( |
no test coverage detected