aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/hash.h
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2013-05-14 22:15:45 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2013-05-29 22:31:16 +0200
commit4c2b3f47382ea46c7886951c3dab0ac357d54392 (patch)
treee5b6c378d51708598ab265b3a12fbcf44db148ab /libavutil/hash.h
parentdccaad3bcdc5762141527cb7db7c87f34517f097 (diff)
downloadffmpeg-4c2b3f47382ea46c7886951c3dab0ac357d54392.tar.gz
Add AV_HASH_MAX_SIZE.
Makes it easier to use static allocation for the result buffer. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavutil/hash.h')
-rw-r--r--libavutil/hash.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavutil/hash.h b/libavutil/hash.h
index 7ecb3e72a9..5dd8712a3e 100644
--- a/libavutil/hash.h
+++ b/libavutil/hash.h
@@ -49,6 +49,18 @@ const char *av_hash_names(int i);
const char *av_hash_get_name(const struct AVHashContext *ctx);
/**
+ * Maximum value that av_hash_get_size will currently return.
+ *
+ * You can use this if you absolutely want or need to use static allocation
+ * and are fine with not supporting hashes newly added to libavutil without
+ * recompilation.
+ * Note that you still need to check against av_hash_get_size, adding new hashes
+ * with larger sizes will not be considered an ABI change and should not cause
+ * your code to overflow a buffer.
+ */
+#define AV_HASH_MAX_SIZE 32
+
+/**
* Get the size of the resulting hash value in bytes.
*
* The pointer passed to av_hash_final have space for at least this many bytes.