Commit 0fb33a82 authored by Michael Niedermayer's avatar Michael Niedermayer

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/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 8b154cb3
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment