From 93ef29b6f47eda7d73eb9e71628f1f1abb64266d Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 14 Oct 2012 21:45:42 +0200 Subject: noise_bsf: fix division by 0 Fixes CID733737 Signed-off-by: Michael Niedermayer --- libavcodec/noise_bsf.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavcodec/noise_bsf.c') diff --git a/libavcodec/noise_bsf.c b/libavcodec/noise_bsf.c index 1cab3e1dba..763af791cb 100644 --- a/libavcodec/noise_bsf.c +++ b/libavcodec/noise_bsf.c @@ -32,6 +32,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); -- cgit v1.2.3