Commit 91038cdb authored by Mans Rullgard's avatar Mans Rullgard

prores: get correct size for coded V plane if alpha is present

The size check must be updated to take into account both manners
in which v_data_size might be set.
Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
parent cd14e297
......@@ -546,9 +546,11 @@ static int decode_slice(AVCodecContext *avctx, ProresThreadData *td)
hdr_size = buf[0] >> 3;
y_data_size = AV_RB16(buf + 2);
u_data_size = AV_RB16(buf + 4);
v_data_size = slice_data_size - y_data_size - u_data_size - hdr_size;
v_data_size = hdr_size > 7 ? AV_RB16(buf + 6) :
slice_data_size - y_data_size - u_data_size - hdr_size;
if (v_data_size < 0 || hdr_size < 6) {
if (hdr_size + y_data_size + u_data_size + v_data_size > slice_data_size ||
v_data_size < 0 || hdr_size < 6) {
av_log(avctx, AV_LOG_ERROR, "invalid data size\n");
return AVERROR_INVALIDDATA;
}
......
0, 0, 12441600, 0x79c18863
0, 3003, 12441600, 0x79c18863
0, 0, 12441600, 0x9d3dc525
0, 3003, 12441600, 0x9d3dc525
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