[FFmpeg-devel] [PATCH] avfilter/avf_showwaves: Check max_samples
Michael Niedermayer
michaelni at gmx.at
Thu Sep 3 19:26:48 CEST 2015
On Thu, Sep 03, 2015 at 08:13:25AM -0700, Ganesh Ajjanagadde wrote:
> On Thu, Sep 3, 2015 at 5:52 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > From: Michael Niedermayer <michael at niedermayer.cc>
> >
> > Fixes potential division by zero
> > Fixes: CID1292295
> >
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> > libavfilter/avf_showwaves.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c
> > index 57a6b2e..a19acf5 100644
> > --- a/libavfilter/avf_showwaves.c
> > +++ b/libavfilter/avf_showwaves.c
> > @@ -203,6 +203,11 @@ static int push_single_pic(AVFilterLink *outlink)
> > int col = 0;
> > int64_t *sum = showwaves->sum;
> >
> > + if (max_samples == 0) {
> > + av_log(ctx, AV_LOG_ERROR, "Too few samples\n");
> > + return AVERROR(EINVAL);
> > + }
> > +
> > av_log(ctx, AV_LOG_DEBUG, "Create frame averaging %"PRId64" samples per column\n", max_samples);
> >
> > memset(sum, 0, nb_channels);
> > --
> > 1.7.9.5
>
> LGTM
applied
thanks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150903/fe59fc2e/attachment.sig>
More information about the ffmpeg-devel
mailing list