summaryrefslogtreecommitdiff
path: root/libavcodec/diracdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-07 00:42:44 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-07 02:24:14 +0100
commit2f6ec9fdd7808c8ed045ae0ca4134ab21fb785e6 (patch)
tree60bbca1105eded94891eab6a150203ad90697492 /libavcodec/diracdec.c
parentb84d1bf193d2af5e06979db12ffa0dedaa6c8ea1 (diff)
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index ef75a536ed..0ee16313af 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;
}