switch (ptype) {
case 0:
while (run-- > 0) {
+ if (y >= avctx->height)
+ return AVERROR_INVALIDDATA;
+
dst[y * linesize + x] = clr;
lx = x;
ly = y;
break;
case 1:
while (run-- > 0) {
+ if (y >= avctx->height)
+ return AVERROR_INVALIDDATA;
+
dst[y * linesize + x] = dst[ly * linesize + lx];
lx = x;
ly = y;
break;
case 2:
while (run-- > 0) {
+ if (y < 1 || y >= avctx->height)
+ return AVERROR_INVALIDDATA;
+
clr = dst[y * linesize + x + off + 1];
dst[y * linesize + x] = clr;
lx = x;
case 4:
while (run-- > 0) {
uint8_t *odst = (uint8_t *)dst;
+
+ if (y < 1 || y >= avctx->height)
+ return AVERROR_INVALIDDATA;
+
r = odst[(ly * linesize + lx) * 4] +
odst[((y * linesize + x) + off) * 4 + 4] -
odst[((y * linesize + x) + off) * 4];
break;
case 5:
while (run-- > 0) {
+ if (y < 1 || y >= avctx->height)
+ return AVERROR_INVALIDDATA;
+
clr = dst[y * linesize + x + off];
dst[y * linesize + x] = clr;
lx = x;