diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-05-22 19:44:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-05-22 20:24:50 +0200 |
commit | 30df9789a9745d8e4b1afc10d1a983bfc8816eb9 (patch) | |
tree | 5b60c848c0909d09053899ecaa72da728b97295c /libavcodec/proresdec2.c | |
parent | df3ee7b9a9564c1b6193f4540db6e72656296118 (diff) | |
download | ffmpeg-30df9789a9745d8e4b1afc10d1a983bfc8816eb9.tar.gz |
proresdec: Fix end condition
Fixes out of array writes
No FFmpeg release is affected by this
This also fixes some artifacts
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/proresdec2.c')
-rw-r--r-- | libavcodec/proresdec2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index 374c5cb8ad..5037bb8e02 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -458,7 +458,7 @@ static void unpack_alpha(GetBitContext *gb, uint16_t *dst, int num_coeffs, } else { dst[idx++] = (alpha_val << 2) | (alpha_val >> 6); } - if (idx == num_coeffs - 1) + if (idx >= num_coeffs) break; } while (get_bits_left(gb)>0 && get_bits1(gb)); val = get_bits(gb, 4); |