diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/filters/comp_filter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/filters/comp_filter.cpp b/src/lib/filters/comp_filter.cpp index 61ac16f38..f909db4a7 100644 --- a/src/lib/filters/comp_filter.cpp +++ b/src/lib/filters/comp_filter.cpp @@ -1,6 +1,7 @@ /* * Filter interface for compression * (C) 2014,2015 Jack Lloyd +* (C) 2015 Matej Kenda * * Botan is released under the Simplified BSD License (see license.txt) */ @@ -23,9 +24,15 @@ Decompression_Filter::Decompression_Filter(const std::string& type, size_t bs) : Compression_Decompression_Filter::Compression_Decompression_Filter(Transform* transform, size_t bs) : m_buffersize(std::max<size_t>(256, bs)), m_buffer(m_buffersize) { + if (!transform) + { + throw std::invalid_argument("Transform is null"); + } m_transform.reset(dynamic_cast<Compressor_Transform*>(transform)); if(!m_transform) + { throw std::invalid_argument("Transform " + transform->name() + " is not a compressor"); + } } std::string Compression_Decompression_Filter::name() const |