[FFmpeg-devel] [PATCH 2/2] swscale/tests/swscale: use codes < 128 for indicating erros
Nicolas George
george at nsup.org
Thu Jul 16 11:27:31 EEST 2020
Michael Niedermayer (12020-07-16):
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
> libswscale/tests/swscale.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c
> index 845ced61bb..9c0b5a4b11 100644
> --- a/libswscale/tests/swscale.c
> +++ b/libswscale/tests/swscale.c
> @@ -248,7 +248,7 @@ end:
> if (dstStride[i])
> av_free(dst[i]);
>
> - return res;
> + return res & 127;
> }
>
> static void selfTest(const uint8_t * const ref[4], int refStride[4],
This looks fragile: there is no local guarantee that res is not a
multiple of 128, and changes in other parts of the code could have that
effect.
Better change the ultimate return value of main to !!res IMHO.
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200716/85edc575/attachment.sig>
More information about the ffmpeg-devel
mailing list