diff options
author | Martin Storsjö <martin@martin.st> | 2013-09-12 12:10:18 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-09-16 11:04:52 +0300 |
commit | ac9d159015a88aa2721b271875d18482f713f354 (patch) | |
tree | 7411460dc0587108db233576645e8e1ec2c17977 | |
parent | e90a6846c2c006fbebd00e1f2789f4a86fafacef (diff) | |
download | ffmpeg-ac9d159015a88aa2721b271875d18482f713f354.tar.gz |
proresdec: Properly make sure an index doesn't run past the limit
If idx equaled num_coeffs - 1 on entry to the loop, the previous
check failed to break out of the loop.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavcodec/proresdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |