From 62d7106c36037d1bedd5a2e216540740f8f735eb Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 18 May 2024 02:45:39 +0200 Subject: [PATCH] avcodec/vlc: Cleanup on multi table alloc failure in ff_vlc_init_multi_from_lengths() Fixes: CID1544630 Resource leak Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavcodec/vlc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vlc.c b/libavcodec/vlc.c index ee09d96fd6..f46ecbb55e 100644 --- a/libavcodec/vlc.c +++ b/libavcodec/vlc.c @@ -529,7 +529,7 @@ int ff_vlc_init_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int multi->table = av_malloc(sizeof(*multi->table) << nb_bits); if (!multi->table) - return AVERROR(ENOMEM); + goto fail; j = code = 0; for (int i = 0; i < nb_codes; i++, lens += lens_wrap) {