Commit 1b5548cc authored by Michael Niedermayer's avatar Michael Niedermayer

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 's avatarMichael Niedermayer <>
(cherry picked from commit d132683d)
Signed-off-by: 's avatarMichael Niedermayer <>
parent df2efc21
......@@ -355,7 +355,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)
p->htaps= htaps;
for(i= htaps/2; i; i--){
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment