| 866 | }; |
| 867 | |
| 868 | uint64_t SnappyDecompressionStream::decompress(const char* input, uint64_t length, char* output, |
| 869 | size_t maxOutputLength) { |
| 870 | size_t outLength; |
| 871 | if (!snappy::GetUncompressedLength(input, length, &outLength)) { |
| 872 | throw ParseError("SnappyDecompressionStream choked on corrupt input"); |
| 873 | } |
| 874 | |
| 875 | if (outLength > maxOutputLength) { |
| 876 | throw CompressionError("Snappy length exceeds block size"); |
| 877 | } |
| 878 | |
| 879 | if (!snappy::RawUncompress(input, length, output)) { |
| 880 | throw ParseError("SnappyDecompressionStream choked on corrupt input"); |
| 881 | } |
| 882 | return outLength; |
| 883 | } |
| 884 | |
| 885 | class LzoDecompressionStream : public BlockDecompressionStream { |
| 886 | public: |
nothing calls this directly
no test coverage detected