From b0e9d9b3a73e2391075ed8f21e4ae71f0d8b886e Mon Sep 17 00:00:00 2001 From: simon987 Date: Sun, 12 Apr 2020 11:45:06 -0400 Subject: [PATCH] Update fastimagehash.go --- fastimagehash.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastimagehash.go b/fastimagehash.go index 02dcbcb..8c45edb 100644 --- a/fastimagehash.go +++ b/fastimagehash.go @@ -16,13 +16,13 @@ import ( const char* Version = FASTIMAGEHASH_VERSION; char *hash_to_hex_string_reversed_wr(void *h, int size) { - char *out = malloc(size * 2 + 1); + char *out = malloc(size * size / 4 + 1); hash_to_hex_string_reversed((uchar*)h, out, size); return out; } char *hash_to_hex_string_wr(void *h, int size) { - char *out = malloc(size * 2 + 1); + char *out = malloc(size * size / 4 + 1); hash_to_hex_string((uchar*)h, out, size); return out; }