summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/scpr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c
index 0623b73c84..f868c474c9 100644
--- a/libavcodec/scpr.c
+++ b/libavcodec/scpr.c
@@ -460,6 +460,9 @@ static int decompress_p(AVCodecContext *avctx,
int run, bx = x * 16 + sx1, by = y * 16 + sy1;
uint32_t r, g, b, clr, ptype = 0;
+ if (bx >= avctx->width)
+ return AVERROR_INVALIDDATA;
+
for (; by < y * 16 + sy2 && by < avctx->height;) {
ret = decode_value(s, s->op_model[ptype], 6, 1000, &ptype);
if (ret < 0)