diff options
author | Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> | 2015-05-05 23:51:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-21 20:43:37 +0200 |
commit | 7d58774360feb20339b68d6e955974f0d632afa4 (patch) | |
tree | 8683661ede90220f1291c74046702e44665a14e4 | |
parent | 448d6488b14179462e28933594d84668aad20d1c (diff) | |
download | ffmpeg-7d58774360feb20339b68d6e955974f0d632afa4.tar.gz |
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 d93181ef3eacdb862d93448f31c97765a523d1db)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/diracdec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index edb56a6e99..966c358786 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -1739,6 +1739,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 */ |