Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-02-03 20:49:07 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2018-02-11 04:49:15 +0300
commit0fb33a82890753233225c61863fff1fcc9d970d4 (patch)
treeefc864d718386ace0dbd371db63ea0464a708fbe /libavcodec/scpr.c
parent8b154cb3e90a3e599cadf477d815a9854b7bb4e1 (diff)
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>
Diffstat (limited to 'libavcodec/scpr.c')
-rw-r--r--libavcodec/scpr.c4
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;