diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-11 15:29:31 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-14 00:21:49 +0200 |
commit | 79f6a1b96ee20eec311e8c44c2bcd5f8fb49f55f (patch) | |
tree | ad8c1d2c7c778d478ec42cf0bc775fc8f59d1bad | |
parent | 9b754ccc53730bc214e15f7613423e4b45059c25 (diff) | |
download | ffmpeg-79f6a1b96ee20eec311e8c44c2bcd5f8fb49f55f.tar.gz |
avcodec/scpr: Check y in first line loop in decompress_i()
Fixes: out of array access
Fixes: 1478/clusterfuzz-testcase-minimized-5285486908145664
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7ac5067146613997bb38442cb022d7f41321a706)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/scpr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c index 465926af19..ea3beae29d 100644 --- a/libavcodec/scpr.c +++ b/libavcodec/scpr.c @@ -331,6 +331,9 @@ static int decompress_i(AVCodecContext *avctx, uint32_t *dst, int linesize) clr = (b << 16) + (g << 8) + r; k += run; while (run-- > 0) { + if (y >= avctx->height) + return AVERROR_INVALIDDATA; + dst[y * linesize + x] = clr; lx = x; ly = y; |