Browse Source

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>
tags/n1.1
Michael Niedermayer 13 years ago
parent
commit
2f6ec9fdd7
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/diracdec.c

+ 1
- 1
libavcodec/diracdec.c 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;
}


Loading…
Cancel
Save