aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-02-03 00:55:18 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-02-03 01:19:45 +0100
commit916da13d6dac8b0d3e8f7b1cb87fa37801cee3f8 (patch)
tree45f480a1c39722c2b6a0ee392ecb8c7de632e0a4
parente9025573faf69416fcc29a689447e3296c3eaf58 (diff)
downloadffmpeg-916da13d6dac8b0d3e8f7b1cb87fa37801cee3f8.tar.gz
cfhd: fix off-by-one error in level check
This fixes out-of-bounds writes causing segmentation faults. Found-by: Piotr Bandurski <ami_stuff@o2.pl> Reviewed-by: Kieran Kunhya <kierank@obe.tv> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavcodec/cfhd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index 410bb7b8f7..2436aae249 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -280,7 +280,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
s->level++;
av_log(avctx, AV_LOG_DEBUG, "Subband number %"PRIu16"\n", data);
s->subband_num = data;
- if (s->level > DWT_LEVELS) {
+ if (s->level >= DWT_LEVELS) {
av_log(avctx, AV_LOG_ERROR, "Invalid level\n");
ret = AVERROR(EINVAL);
break;