diff --git a/libavcodec/proresdec.c b/libavcodec/proresdec.c index c13b76969b..c3b480f18d 100644 --- a/libavcodec/proresdec.c +++ b/libavcodec/proresdec.c @@ -496,7 +496,7 @@ static void unpack_alpha(GetBitContext *gb, uint16_t *dst, int num_coeffs, dst[idx++] = alpha_val >> 6; else dst[idx++] = (alpha_val << 2) | (alpha_val >> 6); - if (idx == num_coeffs - 1) + if (idx >= num_coeffs - 1) break; } while (get_bits1(gb)); val = get_bits(gb, 4);