[FFmpeg-cvslog] noise_bsf: check if allocation failed

Paul B Mahol git at videolan.org
Fri Mar 29 20:17:41 CET 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Mar 29 19:00:16 2013 +0000| [67f9bbbb3f6295ca27da7c367f31c6d65339dd4a] | committer: Paul B Mahol

noise_bsf: check if allocation failed

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=67f9bbbb3f6295ca27da7c367f31c6d65339dd4a
---

 libavcodec/noise_bsf.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/noise_bsf.c b/libavcodec/noise_bsf.c
index 763af79..c91e85b 100644
--- a/libavcodec/noise_bsf.c
+++ b/libavcodec/noise_bsf.c
@@ -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++){



More information about the ffmpeg-cvslog mailing list