noise_bsf: check if allocation failed

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2013-03-29 19:00:16 +00:00
parent 8263726c69
commit 67f9bbbb3f
1 changed files with 2 additions and 0 deletions

View File

@ -36,6 +36,8 @@ static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const ch
return AVERROR(EINVAL);
*poutbuf= av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!*poutbuf)
return AVERROR(ENOMEM);
memcpy(*poutbuf, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
for(i=0; i<buf_size; i++){