From 16164aa30b3ae3dd4e4cb79895431f86bb049c06 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 3 Jun 2025 21:42:24 +0200 Subject: [PATCH 2/9] avcodec/hashtable: Zero-initialize hashtable Otherwise ff_hashtable_freep() would try to free uninitialized pointers upon allocation error (which happens in the corresponding test tool). Signed-off-by: Andreas Rheinhardt --- libavcodec/hashtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/hashtable.c b/libavcodec/hashtable.c index 151476176b..4c7d3e18ba 100644 --- a/libavcodec/hashtable.c +++ b/libavcodec/hashtable.c @@ -58,7 +58,7 @@ struct FFHashtableContext { int ff_hashtable_alloc(struct FFHashtableContext **ctx, size_t key_size, size_t val_size, size_t max_entries) { - struct FFHashtableContext *res = av_malloc(sizeof(struct FFHashtableContext)); + FFHashtableContext *res = av_mallocz(sizeof(*res)); if (!res) return AVERROR(ENOMEM); res->key_size = key_size; -- 2.45.2