[FFmpeg-devel] [PATCH] qsv: fix the dangerous macro definitions

Li, Zhong zhong.li at intel.com
Thu Mar 28 13:55:14 EET 2019


> 2019-03-27 11:24 GMT+01:00, Zhong Li <zhong.li at intel.com>:
> > Signed-off-by: Zhong Li <zhong.li at intel.com>
> > ---
> >  libavcodec/qsv_internal.h | 8 ++++----
> >  libavfilter/qsvvpp.h      | 8 ++++----
> >  2 files changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/libavcodec/qsv_internal.h b/libavcodec/qsv_internal.h
> > index 394c558883..86a5dbad98 100644
> > --- a/libavcodec/qsv_internal.h
> > +++ b/libavcodec/qsv_internal.h
> > @@ -35,12 +35,12 @@
> >  #define QSV_MAX_ENC_PAYLOAD 2       // # of mfxEncodeCtrl
> payloads
> > supported
> >
> >  #define QSV_VERSION_ATLEAST(MAJOR, MINOR)   \
> > -    (MFX_VERSION_MAJOR > (MAJOR) ||         \
> > -     MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >=
> (MINOR))
> > +    ((MFX_VERSION_MAJOR > (MAJOR) ||         \
> > +     MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >=
> (MINOR)))
> 
> This part is not needed, the existing code starts with an opening parenthesis
> that is closed at the end of the macro.

Yes, it is not needed (Mark posted same comment too) and I've updated it in V2 with a new issue fixed.

> >  #define QSV_RUNTIME_VERSION_ATLEAST(MFX_VERSION, MAJOR,
> MINOR) \
> > -    (MFX_VERSION.Major > (MAJOR)) ||
> \
> > -    (MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >=
> (MINOR))
> > +    ((MFX_VERSION.Major > (MAJOR)) ||
> \
> > +    (MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >=
> (MINOR)))
> 
> This one is of course correct.
> 
> Carl Eugen

Thanks for review (Would be nice if you can take a look at patch v2 and then I will apply it). 


More information about the ffmpeg-devel mailing list