Commit db79dedb authored by Andreas Cadhalpun's avatar Andreas Cadhalpun

diracdec: check return code of get_buffer_with_edge

If it fails, buffers aren't allocated, causing NULL pointer dereferencing.
Reviewed-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
parent 24d20496
...@@ -1975,7 +1975,9 @@ static int dirac_decode_picture_header(DiracContext *s) ...@@ -1975,7 +1975,9 @@ static int dirac_decode_picture_header(DiracContext *s)
for (j = 0; j < MAX_FRAMES; j++) for (j = 0; j < MAX_FRAMES; j++)
if (!s->all_frames[j].avframe->data[0]) { if (!s->all_frames[j].avframe->data[0]) {
s->ref_pics[i] = &s->all_frames[j]; s->ref_pics[i] = &s->all_frames[j];
get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF); ret = get_buffer_with_edge(s->avctx, s->ref_pics[i]->avframe, AV_GET_BUFFER_FLAG_REF);
if (ret < 0)
return ret;
break; break;
} }
......
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