[FFmpeg-devel] [PATCH 2/4] avcodec/movtextdec: add () to CMP() macro to avoid unexpected behavior

Michael Niedermayer michael at niedermayer.cc
Fri Feb 25 23:21:29 EET 2022


On Mon, Feb 14, 2022 at 08:52:52PM +0100, Andreas Rheinhardt wrote:
> Michael Niedermayer:
> > Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> > ---
> >  libavcodec/movtextdec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
> > index 825632ca9b..dc30fdc698 100644
> > --- a/libavcodec/movtextdec.c
> > +++ b/libavcodec/movtextdec.c
> > @@ -263,7 +263,7 @@ static int decode_hclr(const uint8_t *tsmb, MovTextContext *m, uint64_t size)
> >  
> >  static int styles_equivalent(const StyleBox *a, const StyleBox *b)
> >  {
> > -#define CMP(field) a->field == b->field
> > +#define CMP(field) ((a)->field == (b)->field)
> >      return CMP(bold)  && CMP(italic)   && CMP(underline) && CMP(color) &&
> >             CMP(alpha) && CMP(fontsize) && CMP(font_id);
> >  #undef CMP
> 
> LGTM.

will apply

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20220225/f05ee3f4/attachment.sig>


More information about the ffmpeg-devel mailing list