diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-26 00:38:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-26 00:38:05 +0200 |
commit | 8a0cd58729364c7d8cf4361aa586f3d0dc43ebb4 (patch) | |
tree | 2c2edbdfdd22d35131b1627948765f061c8fec22 | |
parent | dc30c27eb162f383a0eddb2a7e5e911687255c8e (diff) | |
download | ffmpeg-8a0cd58729364c7d8cf4361aa586f3d0dc43ebb4.tar.gz |
sonic: fix FPE
Fixes Ticket1397
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/sonic.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index da0f5490a1..d42b07de06 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -796,6 +796,11 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx) s->decorrelation = get_bits(&gb, 2); s->downsampling = get_bits(&gb, 2); + if (!s->downsampling) { + av_log(avctx, AV_LOG_ERROR, "invalid downsampling value\n"); + return AVERROR_INVALIDDATA; + } + s->num_taps = (get_bits(&gb, 5)+1)<<5; if (get_bits1(&gb)) // XXX FIXME av_log(avctx, AV_LOG_INFO, "Custom quant table\n"); |