Quoting Nuo Mi (2021-02-14 07:27:39)
> CC      libavcodec/mpegaudiodec_common.o
> libavcodec/movtextenc.c: In function ‘mov_text_style_start’:
> libavcodec/movtextenc.c:358:26: warning: comparison is always false due to 
> limited range of data type [-Wtype-limits]
>   358 |         if (s->count + 1 > SIZE_MAX / sizeof(*s->style_attributes) ||
> ---
>  libavcodec/movtextenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c
> index 1bef21e0b9..cd0e43a79b 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) *  sizeof(*s->style_attributes) > SIZE_MAX ||

What guarantees the multiplication does not overflow?

-- 
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to