Commit d93181ef authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Michael Niedermayer

diracdec: check if reference could not be allocated

s->ref_pics[i] is later used as ref argument of interpolate_refplane,
where it is dereferenced.

If it is NULL, it causes a segmentation fault.
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9e66b39a
......@@ -1745,6 +1745,12 @@ static int dirac_decode_picture_header(DiracContext *s)
get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF);
break;
}
if (!s->ref_pics[i]) {
av_log(s->avctx, AV_LOG_ERROR, "Reference could not be allocated\n");
return -1;
}
}
/* retire the reference frames that are not used anymore */
......
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