[FFmpeg-devel] [PATCH] swscale/tests: check return value of sws_scale

Martin Storsjö martin at martin.st
Wed Jul 8 23:30:24 EEST 2020


On Tue, 7 Jul 2020, Lynne wrote:

> Patch attached.

> From a89bfd810cf40e3005fbcbdcf43a7b858b4dd12c Mon Sep 17 00:00:00 2001
> From: Lynne <dev at lynne.ee>
> Date: Tue, 7 Jul 2020 22:19:14 +0100
> Subject: [PATCH] swscale/tests: check return value of sws_scale
> 
> ---
>  libswscale/tests/swscale.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c
> index 19878a7877..693f439bf5 100644
> --- a/libswscale/tests/swscale.c
> +++ b/libswscale/tests/swscale.c
> @@ -422,7 +422,9 @@ bad_option:
>      for (y = 0; y < H; y++)
>          for (x = 0; x < W * 4; x++)
>              rgb_data[ x + y * 4 * W] = av_lfg_get(&rand);
> -    sws_scale(sws, rgb_src, rgb_stride, 0, H / 12, (uint8_t * const *) src, stride);
> +    res = sws_scale(sws, rgb_src, rgb_stride, 0, H / 12, (uint8_t * const *) src, stride);
> +    if (res < 0 || res != (H / 12))
> +        goto error;

This looks good to me.

Unfortunately (for me, for fixing the arm side of it), I noticed that the 
full test takes a tremendous amount of time to run and isn't part of the 
normal fate run, but I do see that there's options for reducing the number 
of cases tested, that should allow me to test the arm side.

// Martin



More information about the ffmpeg-devel mailing list