ffmpeg | branch: master | Andreas Rheinhardt <[email protected]> | Tue Jun 3 21:42:24 2025 +0200| [2fc310b2f25f9a803c9d5603e2efda384b3f1add] | committer: Andreas Rheinhardt
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). Reviewed-by: Emma Worley <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2fc310b2f25f9a803c9d5603e2efda384b3f1add --- 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; _______________________________________________ ffmpeg-cvslog mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
