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 <michael@niedermayer.cc>
release/7.1
Michael Niedermayer 6 months ago
parent d5cc21741b
commit 62d7106c36
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 2
      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) {

Loading…
Cancel
Save