You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
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 <emma@emma.gg> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -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)
|
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)
|
if (!res)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
res->key_size = key_size;
|
res->key_size = key_size;
|
||||||
|
Reference in New Issue
Block a user