sgidec: fix off by 1 error that tested a sample too far for oob.

This led to decoding failure when linesize was too small.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/59/head
Michael Niedermayer 13 years ago
parent 30659a2233
commit 7bc155163e
  1. 2
      libavcodec/sgidec.c

@ -58,7 +58,7 @@ static int expand_rle_row(SgiState *s, uint8_t *out_buf,
}
/* Check for buffer overflow. */
if(out_buf + pixelstride * count >= out_end) return -1;
if(out_buf + pixelstride * (count-1) >= out_end) return -1;
if (pixel & 0x80) {
while (count--) {

Loading…
Cancel
Save