diff mbox series

[FFmpeg-devel,7/8] libavcodec/movtextenc.c: fix build warning

Message ID 20210220072218.31629-7-yejun.guo@intel.com
State New
Headers show
Series [FFmpeg-devel,1/8] libavdevice/v4l2.c: fix build warning | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Guo, Yejun Feb. 20, 2021, 7:22 a.m. UTC
src/libavcodec/movtextenc.c: In function ‘mov_text_style_start’:
src/libavcodec/movtextenc.c:358:26: warning: comparison is always false due to limited range of data type [-Wtype-limits]
         if (s->count + 1 > SIZE_MAX / sizeof(*s->style_attributes) ||
                          ^
---
 libavcodec/movtextenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c
index 1bef21e0b9..378d8ae3f9 100644
--- a/libavcodec/movtextenc.c
+++ b/libavcodec/movtextenc.c
@@ -355,7 +355,7 @@  static int mov_text_style_start(MovTextContext *s)
         StyleBox *tmp;
 
         // last style != defaults, end the style entry and start a new one
-        if (s->count + 1 > SIZE_MAX / sizeof(*s->style_attributes) ||
+        if (s->count + 1 > UINT_MAX / sizeof(*s->style_attributes) ||
             !(tmp = av_fast_realloc(s->style_attributes,
                                     &s->style_attributes_bytes_allocated,
                                     (s->count + 1) * sizeof(*s->style_attributes)))) {