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>
This commit is contained in:
Michael Niedermayer 2012-12-07 00:42:44 +01:00
parent b84d1bf193
commit 2f6ec9fdd7
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}