aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-12 23:49:36 +0200
committerAnton Khirnov <anton@khirnov.net>2011-09-21 14:28:14 +0200
commita5107aab98bf67ba32eb8b6a3a7478e620b7d3b3 (patch)
tree2ed51b4a1c042eb23c7a349bf1037fc54986d158 /libavcodec
parentbc2dd37e4f6fb549c1b16e9a9791e7b8f31ed112 (diff)
downloadffmpeg-a5107aab98bf67ba32eb8b6a3a7478e620b7d3b3.tar.gz
Check for invalid VLC value in smacker decoder.
Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit 6489455495fc5bfbebcfe3f57e5d4fdd6a781091) Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/smacker.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index e8de0d89c5..9628b07492 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -139,6 +139,8 @@ static int smacker_decode_bigtree(GetBitContext *gb, HuffContext *hc, DBCtx *ctx
b2 = get_bits_count(gb);
i2 = ctx->v2->table ? get_vlc2(gb, ctx->v2->table, SMKTREE_BITS, 3) : 0;
b2 = get_bits_count(gb) - b2;
+ if (i1 < 0 || i2 < 0)
+ return -1;
val = ctx->recode1[i1] | (ctx->recode2[i2] << 8);
if(val == ctx->escapes[0]) {
ctx->last[0] = hc->current;