summaryrefslogtreecommitdiff
path: root/libavcodec/sgidec.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-07-26 21:53:54 +0000
committerPaul B Mahol <onemda@gmail.com>2013-07-27 12:00:25 +0000
commit86e722ab97d7f5f0552c8a0958f7910dfcf3c5b7 (patch)
tree6039bc7b02bbdb2a04b1851695a98153223c16f8 /libavcodec/sgidec.c
parent997e2b59e354a16995656ba16edc293122fd4775 (diff)
downloadffmpeg-86e722ab97d7f5f0552c8a0958f7910dfcf3c5b7.tar.gz
sgidec: safer check for buffer overflow
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/sgidec.c')
-rw-r--r--libavcodec/sgidec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c
index a32620be78..4f7f8ac9f1 100644
--- a/libavcodec/sgidec.c
+++ b/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 - 1) >= out_end)
+ if (out_end - out_buf <= pixelstride * (count - 1))
return AVERROR_INVALIDDATA;
if (pixel & 0x80) {