diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-06-17 00:36:25 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-06-17 00:36:25 +0200 |
commit | 6c655b40eaceb77a8f4a8f32775db969935de746 (patch) | |
tree | 827f60438d46fff1b950ec87a750869d5365a48a /libavcodec/smacker.c | |
parent | 85a3d20da55ff0eafff8ff6a3e52d52204fc6fd7 (diff) | |
parent | bbb2945f2dfbc2306c1655bf7eb6e220912a9a7c (diff) | |
download | ffmpeg-6c655b40eaceb77a8f4a8f32775db969935de746.tar.gz |
Merge commit 'bbb2945f2dfbc2306c1655bf7eb6e220912a9a7c'
* commit 'bbb2945f2dfbc2306c1655bf7eb6e220912a9a7c':
smacker: check the return value of smacker_decode_tree
Conflicts:
libavcodec/smacker.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/smacker.c')
-rw-r--r-- | libavcodec/smacker.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index f30d4b3089..21d60f85e1 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -646,9 +646,16 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, h[i].lengths = av_mallocz(256 * sizeof(int)); h[i].values = av_mallocz(256 * sizeof(int)); skip_bits1(&gb); - res = smacker_decode_tree(&gb, &h[i], 0, 0); - if (res < 0) - return res; + if (smacker_decode_tree(&gb, &h[i], 0, 0) < 0) { + for (; i >= 0; i--) { + if (vlc[i].table) + ff_free_vlc(&vlc[i]); + av_free(h[i].bits); + av_free(h[i].lengths); + av_free(h[i].values); + } + return AVERROR_INVALIDDATA; + } skip_bits1(&gb); if(h[i].current > 1) { res = init_vlc(&vlc[i], SMKTREE_BITS, h[i].length, |