Commit 7b12554c authored by Paul B Mahol's avatar Paul B Mahol

exr: make sure that data_size is not bigger than expected

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 74a78bfe
......@@ -270,7 +270,8 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
uncompressed_size = s->scan_line_size * FFMIN(s->scan_lines_per_block, s->ymax - line + 1);
if ((s->compr == EXR_RAW && (data_size != uncompressed_size ||
line_offset > buf_size - uncompressed_size)) ||
(s->compr != EXR_RAW && line_offset > buf_size - data_size)) {
(s->compr != EXR_RAW && (data_size > uncompressed_size ||
line_offset > buf_size - data_size))) {
return AVERROR_INVALIDDATA;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment