diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-01-20 20:20:42 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-07-02 23:44:51 +0200 |
commit | 30cf495505cf897eb25a89d0f915e49733e4c36b (patch) | |
tree | 2ddd74d20dcc94f42de369b83686637c7388d9e8 /libavutil/utils.c | |
parent | 040a93fe0a6a80f63e935fea2ea97870fa3ed416 (diff) | |
download | ffmpeg-30cf495505cf897eb25a89d0f915e49733e4c36b.tar.gz |
avcodec/adxenc: Avoid undefined left shift of negative numbers
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.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 59a9d65e0d790821f88527a82569f56eb2f8a9be)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavutil/utils.c')
0 files changed, 0 insertions, 0 deletions