aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-02-03 18:49:07 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-04-13 00:35:15 +0200
commit55e6c6b5feb7e2a9110fab1dc06ced23360b14e2 (patch)
tree57eca6bfff3c75e085eeee60d0aec1e083cea60b
parent66881cf2b58b8021e9e7f4271e30deeba0c6cb7f (diff)
downloadffmpeg-55e6c6b5feb7e2a9110fab1dc06ced23360b14e2.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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c
index 78a6d5c0cd..694450abf0 100644
--- a/libavcodec/scpr.c
+++ b/libavcodec/scpr.c
@@ -679,6 +679,8 @@ static int decompress_p(AVCodecContext *avctx,
return AVERROR_INVALIDDATA;
if (bx == 0) {
+ if (by < 2)
+ return AVERROR_INVALIDDATA;
z = backstep;
} else {
z = 0;
@@ -708,6 +710,8 @@ static int decompress_p(AVCodecContext *avctx,
return AVERROR_INVALIDDATA;
if (bx == 0) {
+ if (by < 2)
+ return AVERROR_INVALIDDATA;
z = backstep;
} else {
z = 0;