avcodec/scpr: Check y in first line loop in decompress_i()
[ffmpeg.git] / libavcodec / scpr.c
index ba1f65f2e9b88e1edd5c7cf60ff11d38082d7487..b87c047ab659126e8e4a52c3c614fa1cb5cb43fb 100644 (file)
@@ -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;