diff mbox series

[FFmpeg-devel] avfilter/vf_drawtext: only test available exceptions

Message ID 20200407003859.117517-1-rosenp@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel] avfilter/vf_drawtext: only test available exceptions | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Rosen Penev April 7, 2020, 12:38 a.m. UTC
soft float systems do not define these macros under musl.

Fixes: Ticket7102

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 libavfilter/vf_drawtext.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Carl Eugen Hoyos April 7, 2020, 11:36 p.m. UTC | #1
Am Di., 7. Apr. 2020 um 02:46 Uhr schrieb Rosen Penev <rosenp@gmail.com>:
>
> soft float systems do not define these macros under musl.
>
> Fixes: Ticket7102

I will push this if nobody objects.

Carl Eugen
Carl Eugen Hoyos April 8, 2020, 11:01 p.m. UTC | #2
Am Di., 7. Apr. 2020 um 02:46 Uhr schrieb Rosen Penev <rosenp@gmail.com>:
>
> soft float systems do not define these macros under musl.
>
> Fixes: Ticket7102
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  libavfilter/vf_drawtext.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
> index 887a686d16..abe1ca6c35 100644
> --- a/libavfilter/vf_drawtext.c
> +++ b/libavfilter/vf_drawtext.c
> @@ -1085,10 +1085,12 @@ static int func_eval_expr_int_format(AVFilterContext *ctx, AVBPrint *bp,
>
>      feclearexcept(FE_ALL_EXCEPT);
>      intval = res;
> +#if defined(FE_INVALID) && defined(FE_OVERFLOW) && defined(FE_UNDERFLOW)
>      if ((ret = fetestexcept(FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW))) {
>          av_log(ctx, AV_LOG_ERROR, "Conversion of floating-point result to int failed. Control register: 0x%08x. Conversion result: %d\n", ret, intval);
>          return AVERROR(EINVAL);
>      }
> +#endif

Patch applied.

Thank you, Carl Eugen
diff mbox series

Patch

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 887a686d16..abe1ca6c35 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -1085,10 +1085,12 @@  static int func_eval_expr_int_format(AVFilterContext *ctx, AVBPrint *bp,
 
     feclearexcept(FE_ALL_EXCEPT);
     intval = res;
+#if defined(FE_INVALID) && defined(FE_OVERFLOW) && defined(FE_UNDERFLOW)
     if ((ret = fetestexcept(FE_INVALID|FE_OVERFLOW|FE_UNDERFLOW))) {
         av_log(ctx, AV_LOG_ERROR, "Conversion of floating-point result to int failed. Control register: 0x%08x. Conversion result: %d\n", ret, intval);
         return AVERROR(EINVAL);
     }
+#endif
 
     if (argc == 3)
         av_strlcatf(fmt_str, sizeof(fmt_str), "0%u", positions);