[FFmpeg-devel] [PATCH] avutil/mathematics: remove superfluous asserts from av_rescale_rnd

Michael Niedermayer michaelni at gmx.at
Sat Feb 28 22:06:56 CET 2015


On Sat, Feb 28, 2015 at 08:21:21PM +0100, Andreas Cadhalpun wrote:
> Hi,
> 
> the asserts in av_rescale_rnd are unnecessary since commit 3929c174.
> 
> Best regards,
> Andreas

>  mathematics.c |    3 ---
>  1 file changed, 3 deletions(-)
> 9af17404d606e3f9a6a5c37a515dfae8ac371313  0001-avutil-mathematics-remove-superfluous-asserts-from-a.patch
> From 932813ac54beaca4c1e02d76b76c50097d0f1336 Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> Date: Sat, 28 Feb 2015 19:45:31 +0100
> Subject: [PATCH] avutil/mathematics: remove superfluous asserts from
>  av_rescale_rnd
> 
> The function returns INT64_MIN in these cases and it is called with

we do not check the return
code of av_rescale_rnd() in practically all cases so using it as a
means to handle errors simply does not work.
Also checking its return code everywhere would be quite annoying
and wouldnt really work because the input shouldnt be invalid in the
first place and should have been checked before


> potentially negative values e.g. from av_image_check_sar.

fixed

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150228/97237f81/attachment.asc>


More information about the ffmpeg-devel mailing list