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

Michael Niedermayer git at videolan.org
Tue Mar 29 02:27:47 EEST 2022


ffmpeg | branch: release/5.0 | Michael Niedermayer <michael at niedermayer.cc> | Mon Feb 14 20:20:47 2022 +0100| [405c75998d5dc2a700362ec1163133c67cf361c5] | 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>
(cherry picked from commit c182c706589de2b513331c61a8597fa863d4e97f)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 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