diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-08-17 21:32:03 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-08-22 00:27:35 +0300 |
commit | 7829a712bb5af978289df8287160ea27d1e056ce (patch) | |
tree | ecc6fede4ab2dd53caf1f0606882694a7390f41a | |
parent | b463a0347636fce1a55a6fcaeb4d8827d2929f2c (diff) |
avcodec/snowdec: Fix off by 1 error
Fixes: runtime error: index 4 out of bounds for type 'int8_t [4]'
Fixes: 3023/clusterfuzz-testcase-minimized-6421736130084864
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d132683ddd4050d3fe103ca88c73258c3442dc34)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/snowdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index 4d50026d71..96c61ec3f9 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -352,7 +352,7 @@ static int decode_header(SnowContext *s){ Plane *p= &s->plane[plane_index]; p->diag_mc= get_rac(&s->c, s->header_state); htaps= get_symbol(&s->c, s->header_state, 0)*2 + 2; - if((unsigned)htaps > HTAPS_MAX || htaps==0) + if((unsigned)htaps >= HTAPS_MAX || htaps==0) return AVERROR_INVALIDDATA; p->htaps= htaps; for(i= htaps/2; i; i--){ |