mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
jpeglsdec: Prevent out of array write.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
dda713f870
commit
00ab9cdae1
@ -198,6 +198,9 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s, void *
|
|||||||
r = ff_log2_run[state->run_index[comp]];
|
r = ff_log2_run[state->run_index[comp]];
|
||||||
if(r)
|
if(r)
|
||||||
r = get_bits_long(&s->gb, r);
|
r = get_bits_long(&s->gb, r);
|
||||||
|
if(x + r * stride > w) {
|
||||||
|
r = (w - x) / stride;
|
||||||
|
}
|
||||||
for(i = 0; i < r; i++) {
|
for(i = 0; i < r; i++) {
|
||||||
W(dst, x, Ra);
|
W(dst, x, Ra);
|
||||||
x += stride;
|
x += stride;
|
||||||
|
Loading…
Reference in New Issue
Block a user