Browse Source

sgidec: safer check for buffer overflow

Signed-off-by: Paul B Mahol <onemda@gmail.com>
tags/n2.1
Paul B Mahol 12 years ago
parent
commit
86e722ab97
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/sgidec.c

+ 1
- 1
libavcodec/sgidec.c View File

@@ -58,7 +58,7 @@ static int expand_rle_row(SgiState *s, uint8_t *out_buf,
}

/* Check for buffer overflow. */
if (out_buf + pixelstride * (count - 1) >= out_end)
if (out_end - out_buf <= pixelstride * (count - 1))
return AVERROR_INVALIDDATA;

if (pixel & 0x80) {


Loading…
Cancel
Save