diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-14 21:45:42 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-25 21:19:56 +0200 |
commit | 5b5e61a0bf0d8f81ac5bf29b844af2c6e1081235 (patch) | |
tree | ea5b3afd74a9c70cccd1b4bb0a6a6da37fa91a68 | |
parent | 7f1fb8d2a367a20cdb674efb71346ba19c4f9e21 (diff) | |
download | ffmpeg-5b5e61a0bf0d8f81ac5bf29b844af2c6e1081235.tar.gz |
noise_bsf: fix division by 0
Fixes CID733737
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 93ef29b6f47eda7d73eb9e71628f1f1abb64266d)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/noise_bsf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/noise_bsf.c b/libavcodec/noise_bsf.c index 491fbccc1d..18a7f30886 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); |