diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-23 13:29:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-23 13:29:58 +0200 |
commit | eed40b29570b7ef5695ab2296cc634278d533c50 (patch) | |
tree | f1ad1839735a93605bf0646fddca0ecc8ebd1657 /libavcodec/vc1dec.c | |
parent | 621845feccd15cb035d55089aa16e07514fab89e (diff) | |
parent | ede508443e4bf57dc1e019fac81bf6244b88fbd3 (diff) | |
download | ffmpeg-eed40b29570b7ef5695ab2296cc634278d533c50.tar.gz |
Merge commit 'ede508443e4bf57dc1e019fac81bf6244b88fbd3'
* commit 'ede508443e4bf57dc1e019fac81bf6244b88fbd3':
vc1dec: Fix leaks in ff_vc1_decode_init_alloc_tables on errors
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r-- | libavcodec/vc1dec.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 9bd5f69b34..d3a3616f3a 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5538,8 +5538,19 @@ av_cold int ff_vc1_decode_init_alloc_tables(VC1Context *v) if (!v->mv_type_mb_plane || !v->direct_mb_plane || !v->acpred_plane || !v->over_flags_plane || !v->block || !v->cbp_base || !v->ttblk_base || !v->is_intra_base || !v->luma_mv_base || - !v->mb_type_base) - return -1; + !v->mb_type_base) { + av_freep(&v->mv_type_mb_plane); + av_freep(&v->direct_mb_plane); + av_freep(&v->acpred_plane); + av_freep(&v->over_flags_plane); + av_freep(&v->block); + av_freep(&v->cbp_base); + av_freep(&v->ttblk_base); + av_freep(&v->is_intra_base); + av_freep(&v->luma_mv_base); + av_freep(&v->mb_type_base); + return AVERROR(ENOMEM); + } return 0; } |