summaryrefslogtreecommitdiff
path: root/libavcodec/scpr.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/scpr.c')
-rw-r--r--libavcodec/scpr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/scpr.c b/libavcodec/scpr.c
index ba1f65f2e9..b87c047ab6 100644
--- a/libavcodec/scpr.c
+++ b/libavcodec/scpr.c
@@ -331,6 +331,9 @@ static int decompress_i(AVCodecContext *avctx, uint32_t *dst, int linesize)
clr = (b << 16) + (g << 8) + r;
k += run;
while (run-- > 0) {
+ if (y >= avctx->height)
+ return AVERROR_INVALIDDATA;
+
dst[y * linesize + x] = clr;
lx = x;
ly = y;