On Mon, Jan 20, 2020 at 08:20:42PM +0100, Andreas Rheinhardt wrote:
> Replace "((a << shift) + b) >> shift" by "a + (b >> shift)". This avoids
> a left shift which also happens to trigger undefined behaviour in case "a"
> is negative. This affected the FATE-tests acodec-adpcm-adx and
> acodec-adpcm-adx-trellis; it also fixes ticket #8008.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com>
> ---
> The equivalence of the old code and the new code in the first two
> changes is clear from the type of wav[i] (int16_t) and the fact that
> COEFF_BITS is 12 (i.e. no high bits are lost when left shifting); for
> the last change the equivalence depends upon scale being representable
> in an uint16_t. I don't know whether this is indeed so (the direct
> estimate gives an upper bound of (2^19 + 2^15 + 1) / 7), but it better
> should be so because scale is written via AV_WB16. Maybe it should be
> clipped if it is outside of this range?
> 
>  libavcodec/adxenc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

will apply patchset

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to