diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-03 18:49:07 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-02-11 19:41:43 +0100 |
commit | c4153d40d5d8a38a9762fbc9626728beba5887e4 (patch) | |
tree | 6fd154b7ba56176f8ffff05b101f164abad2ce12 | |
parent | cc0d2f110d9424b0240ac31599e70949169106e1 (diff) | |
download | ffmpeg-c4153d40d5d8a38a9762fbc9626728beba5887e4.tar.gz |
avcodec/scpr: Fix reading a pixel before the first
Fixes: 5540/clusterfuzz-testcase-minimized-6122458273808384
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0fb33a82890753233225c61863fff1fcc9d970d4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/scpr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c index cbe1bc40d9..ad6073dbf0 100644 --- a/libavcodec/scpr.c +++ b/libavcodec/scpr.c @@ -681,6 +681,8 @@ static int decompress_p(AVCodecContext *avctx, return AVERROR_INVALIDDATA; if (bx == 0) { + if (by < 2) + return AVERROR_INVALIDDATA; z = backstep; } else { z = 0; @@ -710,6 +712,8 @@ static int decompress_p(AVCodecContext *avctx, return AVERROR_INVALIDDATA; if (bx == 0) { + if (by < 2) + return AVERROR_INVALIDDATA; z = backstep; } else { z = 0; |