diff options
author | Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> | 2015-05-05 23:51:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-06 01:54:51 +0200 |
commit | d93181ef3eacdb862d93448f31c97765a523d1db (patch) | |
tree | c97b9da4410e8a7e6083895280ae1b85a8fe688c /libavcodec/diracdec.c | |
parent | 9e66b39aa87eb653a6e5d15f70b792ccbf719de7 (diff) | |
download | ffmpeg-d93181ef3eacdb862d93448f31c97765a523d1db.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>
Diffstat (limited to 'libavcodec/diracdec.c')
-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 adbe331e95..bb0f2c77d9 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -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 */ |