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

Michael Niedermayer michael at niedermayer.cc
Thu Jul 9 02:29:22 EEST 2020


On Tue, Jul 07, 2020 at 11:22:20PM +0200, Lynne wrote:
> Patch attached.
> 

>  swscale.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> e4eb17aee95423afb258e2368ac1503720393263  0001-swscale-tests-check-return-value-of-sws_scale.patch
> 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))

if iam not mistaken, this should be res != H, not /12

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Never trust a computer, one day, it may think you are the virus. -- Compn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200709/be20369b/attachment.sig>


More information about the ffmpeg-devel mailing list