[FFmpeg-devel] [PATCH] avfilter/vf_lut3d: check size in parse_dat()

Michael Niedermayer michaelni at gmx.at
Sat May 10 14:53:57 CEST 2014


On Sat, May 10, 2014 at 01:46:22PM +0200, Clément Bœsch wrote:
> On Sat, May 10, 2014 at 04:26:53AM +0200, Michael Niedermayer wrote:
> > Fixes CID1212261
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavfilter/vf_lut3d.c |    7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
> > index 85e270c..7b2f83f 100644
> > --- a/libavfilter/vf_lut3d.c
> > +++ b/libavfilter/vf_lut3d.c
> > @@ -274,7 +274,12 @@ static int parse_dat(AVFilterContext *ctx, FILE *f)
> >  
> >      NEXT_LINE(skip_line(line));
> >      if (!strncmp(line, "3DLUTSIZE ", 10)) {
> > -        lut3d->lutsize = size = strtol(line + 10, NULL, 0);
> > +        size = strtol(line + 10, NULL, 0);
> > +        if (size < 2 || size > MAX_LEVEL) {
> > +            av_log(ctx, AV_LOG_ERROR, "Too large or invalid 3D LUT size\n");
> > +            return AVERROR(EINVAL);
> > +        }
> > +        lut3d->lutsize = size;
> 
> LGTM, thanks

applied
thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140510/10dca1bc/attachment.asc>


More information about the ffmpeg-devel mailing list