noise_bsf: check if allocation failed
authorPaul B Mahol <onemda@gmail.com>
Fri, 29 Mar 2013 19:00:16 +0000 (19:00 +0000)
committerPaul B Mahol <onemda@gmail.com>
Fri, 29 Mar 2013 19:00:16 +0000 (19:00 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/noise_bsf.c

index 763af79..c91e85b 100644 (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++){