Browse Source

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: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d93181ef3e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4.10
Andreas Cadhalpun Michael Niedermayer 10 years ago
parent
commit
c646ee3da7
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavcodec/diracdec.c

+ 6
- 0
libavcodec/diracdec.c View File

@@ -1747,6 +1747,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 */


Loading…
Cancel
Save