aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-05-12 14:20:51 +0100
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2016-05-12 14:20:51 +0100
commit22900770c56d36868bf2dc758f721d02730092dd (patch)
tree92bdaac8f94e7e10a074f5808ea401fba645f26a /libavcodec
parent3fd5f09845e54bcd61a817b57c054d55f6b6fe5d (diff)
parentf3fdef108eb06b1e71b29152bf6822519e787efe (diff)
downloadffmpeg-22900770c56d36868bf2dc758f721d02730092dd.tar.gz
Merge commit 'f3fdef108eb06b1e71b29152bf6822519e787efe'
* commit 'f3fdef108eb06b1e71b29152bf6822519e787efe': ape: Avoid undefined behaviour Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/apedec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index de9d71ca40..b028e94ad2 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1284,7 +1284,7 @@ static void do_apply_filter(APEContext *ctx, int version, APEFilter *f,
/* Update the adaption coefficients */
absres = FFABS(res);
if (absres)
- *f->adaptcoeffs = ((res & INT32_MIN) ^ (-(1<<30))) >>
+ *f->adaptcoeffs = ((res & INT32_MIN) ^ ((~0UL) << 30)) >>
(25 + (absres <= f->avg*3) + (absres <= f->avg*4/3));
else
*f->adaptcoeffs = 0;