aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-20 11:16:00 +0300
committerLuca Barbato <lu_zero@gentoo.org>2014-01-07 09:43:57 +0100
commit159993acc7f4e3155510d42c543e09fe972b933c (patch)
tree5de426b13af695f2b314fbdf0fc2994e49620d6a
parentb29c31c21e6d9d791b413146defb1986032d72b5 (diff)
downloadffmpeg-159993acc7f4e3155510d42c543e09fe972b933c.tar.gz
vc1dec: Fix leaks in ff_vc1_decode_init_alloc_tables on errors
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit ede508443e4bf57dc1e019fac81bf6244b88fbd3) Signed-off-by: Luca Barbato <lu_zero@gentoo.org> (cherry picked from commit b62704891d2353679e012555ac9e9a49ee63d497)
-rw-r--r--libavcodec/vc1dec.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index e1aa4e65d8..328c5a69c5 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -5126,8 +5126,19 @@ static av_cold int 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;
}