[FFmpeg-cvslog] noise_bsf: fix division by 0

Michael Niedermayer git at videolan.org
Thu Oct 25 21:29:20 CEST 2012


ffmpeg | branch: release/0.10 | Michael Niedermayer <michaelni at gmx.at> | Sun Oct 14 21:45:42 2012 +0200| [5b5e61a0bf0d8f81ac5bf29b844af2c6e1081235] | committer: Michael Niedermayer

noise_bsf: fix division by 0

Fixes CID733737
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 93ef29b6f47eda7d73eb9e71628f1f1abb64266d)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/noise_bsf.c b/libavcodec/noise_bsf.c
index 491fbcc..18a7f30 100644
--- a/libavcodec/noise_bsf.c
+++ b/libavcodec/noise_bsf.c
@@ -28,6 +28,9 @@ static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const ch
     int amount= args ? atoi(args) : (*state % 10001+1);
     int i;
 
+    if(amount <= 0)
+        return AVERROR(EINVAL);
+
     *poutbuf= av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
 
     memcpy(*poutbuf, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);



More information about the ffmpeg-cvslog mailing list