avcodec/iff: Fix bytestream advance

Fixes Ticket5585

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/221/head
Michael Niedermayer 9 years ago
parent bd3fd467fe
commit c3ad63c6a3
  1. 2
      libavcodec/iff.c

@ -541,6 +541,8 @@ static int decode_byterun(uint8_t *dst, int dst_size,
if (value >= 0) {
length = FFMIN3(value + 1, dst_size - x, bytestream2_get_bytes_left(gb));
bytestream2_get_buffer(gb, dst + x, length);
if (length < value + 1)
bytestream2_skip(gb, value + 1 - length);
} else if (value > -128) {
length = FFMIN(-value + 1, dst_size - x);
memset(dst + x, bytestream2_get_byte(gb), length);

Loading…
Cancel
Save