B = ((pred >> B_shift) & 0xFF) - TOSIGNED(delta);
}
- if (R<0 || G<0 || B<0) {
- av_log(NULL, AV_LOG_ERROR, "RGB %d %d %d is out of range\n", R, G, B);
+ if (R<0 || G<0 || B<0 || R > 255 || G > 255 || B > 255) {
+ avpriv_request_sample(NULL, "RGB %d %d %d is out of range\n", R, G, B);
return 0;
}
if (c->ec.els_ctx.err != 0) {
av_log(avctx, AV_LOG_ERROR,
"ePIC: couldn't decode transparency pixel!\n");
+ ff_els_decoder_uninit(&c->ec.unsigned_rung);
return AVERROR_INVALIDDATA;
}
} else {
dst += x * 3;
}
- if (y < 0) {
+
+ if (y < 0)
h += y;
+ if (w < 0 || h < 0)
+ return;
+ if (y < 0) {
cursor += -y * c->cursor_stride;
} else {
dst += y * stride;
}
- if (w < 0 || h < 0)
- return;
for (j = 0; j < h; j++) {
for (i = 0; i < w; i++) {