diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-21 11:55:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-04-21 11:55:19 +0200 |
commit | 83330cf5fae65423c24c5a0fb3705675236d88ed (patch) | |
tree | 23979ae08fdae55e0f46da778ed6cee90ac57cf6 | |
parent | 0c77cdb491de7a178e4142cb6a24538eec6b4f64 (diff) | |
download | ffmpeg-83330cf5fae65423c24c5a0fb3705675236d88ed.tar.gz |
init_vlc_sparse: fix leak on error
Fixes CID1005312
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/bitstream.c | 2 |
1 files changed, 2 insertions, 0 deletions
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<<buf[j].bits)) {\ av_log(NULL, AV_LOG_ERROR, "Invalid code in init_vlc\n");\ + av_free(buf);\ return -1;\ }\ if (flags & INIT_VLC_LE)\ |