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>
This commit is contained in:
Michael Niedermayer 2018-02-03 18:49:07 +01:00
parent 8b154cb3e9
commit 0fb33a8289

View File

@ -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;