diff options
Diffstat (limited to 'core/crypto')
-rw-r--r-- | core/crypto/crypto.cpp | 2 | ||||
-rw-r--r-- | core/crypto/hashing_context.cpp | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/core/crypto/crypto.cpp b/core/crypto/crypto.cpp index 925a01b36a..83a25da901 100644 --- a/core/crypto/crypto.cpp +++ b/core/crypto/crypto.cpp @@ -149,7 +149,7 @@ Error ResourceFormatSaverCrypto::save(const String &p_path, const RES &p_resourc } else { ERR_FAIL_V(ERR_INVALID_PARAMETER); } - ERR_FAIL_COND_V(err != OK, err); + ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot save Crypto resource to file '" + p_path + "'."); return OK; } diff --git a/core/crypto/hashing_context.cpp b/core/crypto/hashing_context.cpp index bdccb258dd..b5aa0ddc18 100644 --- a/core/crypto/hashing_context.cpp +++ b/core/crypto/hashing_context.cpp @@ -50,6 +50,7 @@ Error HashingContext::start(HashType p_type) { Error HashingContext::update(PoolByteArray p_chunk) { ERR_FAIL_COND_V(ctx == NULL, ERR_UNCONFIGURED); size_t len = p_chunk.size(); + ERR_FAIL_COND_V(len == 0, FAILED); PoolByteArray::Read r = p_chunk.read(); switch (type) { case HASH_MD5: @@ -103,7 +104,7 @@ void HashingContext::_create_ctx(HashType p_type) { } void HashingContext::_delete_ctx() { - return; + switch (type) { case HASH_MD5: memdelete((CryptoCore::MD5Context *)ctx); |