On Thu, Jan 30, 2014 at 2:20 PM, Luca Barbato <lu_z...@gentoo.org> wrote:
>
> On 30/01/14 20:11, Justin Ruggles wrote:
> > CC:libav-sta...@libav.org
> > ---
> >  libavutil/samplefmt.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/libavutil/samplefmt.c b/libavutil/samplefmt.c
> > index 389f726..bff6004 100644
> > --- a/libavutil/samplefmt.c
> > +++ b/libavutil/samplefmt.c
> > @@ -118,6 +118,8 @@ int av_samples_get_buffer_size(int *linesize, int 
> > nb_channels, int nb_samples,
> >
> >      /* auto-select alignment if not specified */
> >      if (!align) {
> > +        if (nb_samples > INT_MAX - 31)
> > +            return AVERROR(EINVAL);
> >          align = 1;
> >          nb_samples = FFALIGN(nb_samples, 32);
> >      }
> >
>
> Sounds safe.

In the long term, would it make sense for the nb_channels and
nb_samples arguments to be changed to unsigned (i.e. in new API)?
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to