aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/sgidec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-09 01:31:41 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-09 01:33:44 +0200
commit7bc155163ec08a0302526d7e19d08c8053f932f0 (patch)
tree2c87d925d80d98228abb91ffce2d8221e48d564c /libavcodec/sgidec.c
parent30659a2233772f9dfcda3a9928b93bba00308687 (diff)
downloadandroid_external_ffmpeg-7bc155163ec08a0302526d7e19d08c8053f932f0.tar.gz
android_external_ffmpeg-7bc155163ec08a0302526d7e19d08c8053f932f0.tar.bz2
android_external_ffmpeg-7bc155163ec08a0302526d7e19d08c8053f932f0.zip
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>
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 4e8fd31ef1..f11efd05ee 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 >= out_end) return -1;
+ if(out_buf + pixelstride * (count-1) >= out_end) return -1;
if (pixel & 0x80) {
while (count--) {