const int is_chroma = !!plane;
const uint8_t *qmat = is_chroma ? chroma_quant : luma_quant;
+ if (get_bits_left(gb) < 1)
+ return AVERROR_INVALIDDATA;
+
c->bdsp.clear_block(block);
dc = get_vlc2(gb, c->dc_vlc[is_chroma].table, 9, 3);
if (dc < 0)
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;
}
uint32_t ref_pix = curr_row[x - 1];
if (!x || !epic_decode_from_cache(dc, ref_pix, &pix)) {
pix = epic_decode_pixel_pred(dc, x, y, curr_row, above_row);
+ if (is_pixel_on_stack(dc, pix))
+ return AVERROR_INVALIDDATA;
+
if (x) {
int ret = epic_add_pixel_to_cache(&dc->hash,
ref_pix,
} 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++) {