From 83330cf5fae65423c24c5a0fb3705675236d88ed Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 21 Apr 2013 11:55:19 +0200 Subject: [PATCH] init_vlc_sparse: fix leak on error Fixes CID1005312 Signed-off-by: Michael Niedermayer --- libavcodec/bitstream.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index 2dda9bbf7b..7e297b9270 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -307,11 +307,13 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, continue;\ if (buf[j].bits > 3*nb_bits || buf[j].bits>32) {\ av_log(NULL, AV_LOG_ERROR, "Too long VLC in init_vlc\n");\ + av_free(buf);\ return -1;\ }\ GET_DATA(buf[j].code, codes, i, codes_wrap, codes_size);\ if (buf[j].code >= (1LL<