diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-07 00:42:44 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-07 02:24:14 +0100 |
commit | 2f6ec9fdd7808c8ed045ae0ca4134ab21fb785e6 (patch) | |
tree | 60bbca1105eded94891eab6a150203ad90697492 /libavcodec/diracdec.c | |
parent | b84d1bf193d2af5e06979db12ffa0dedaa6c8ea1 (diff) | |
download | ffmpeg-streaming-2f6ec9fdd7808c8ed045ae0ca4134ab21fb785e6.zip ffmpeg-streaming-2f6ec9fdd7808c8ed045ae0ca4134ab21fb785e6.tar.gz |
diracdec: Test mctmp and mcscratch for malloc failure.
Fixes null pointer dereference
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/diracdec.c')
-rw-r--r-- | libavcodec/diracdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index ef75a53..0ee1631 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -353,7 +353,7 @@ static int alloc_sequence_buffers(DiracContext *s) s->mctmp = av_malloc((w+64+MAX_BLOCKSIZE) * (h*MAX_BLOCKSIZE) * sizeof(*s->mctmp)); s->mcscratch = av_malloc((w+64)*MAX_BLOCKSIZE); - if (!s->sbsplit || !s->blmotion) + if (!s->sbsplit || !s->blmotion || !s->mctmp || !s->mcscratch) return AVERROR(ENOMEM); return 0; } |