[FFmpeg-cvslog] avcodec/movtextdec: add () to CMP() macro to avoid unexpected behavior

Michael Niedermayer git at videolan.org
Fri Feb 25 23:30:55 EET 2022


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Feb 14 20:20:47 2022 +0100| [c182c706589de2b513331c61a8597fa863d4e97f] | committer: Michael Niedermayer

avcodec/movtextdec: add () to CMP() macro to avoid unexpected behavior

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c182c706589de2b513331c61a8597fa863d4e97f
---

 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



More information about the ffmpeg-cvslog mailing list