aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-09-25 00:03:07 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-05-20 03:35:10 +0200
commit4f5168e808c38391c7f89d834fc6d793dbba61e1 (patch)
tree7a3c98e442cb9530f54a7858d9fc65600e6b2077 /libavcodec
parentd58dab562b7229961e837b3e5205aa52fdc00a3e (diff)
downloadffmpeg-4f5168e808c38391c7f89d834fc6d793dbba61e1.tar.gz
avcodec/exr: Fix undefined left shifts of negative numbers
Affected the FATE-tests exr-rgb-scanline-pxr24-half-uint32-13x9 and exr-rgb-scanline-pxr24-uint32. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 8b0f949906116c40b6f1e55a1bce4447ada3219c)
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/exr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 819837f024..ba6e3fdcb6 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -881,7 +881,7 @@ static int pxr24_uncompress(EXRContext *s, const uint8_t *src,
in = ptr[3] + s->xdelta;
for (j = 0; j < s->xdelta; ++j) {
- uint32_t diff = (*(ptr[0]++) << 24) |
+ uint32_t diff = ((uint32_t)*(ptr[0]++) << 24) |
(*(ptr[1]++) << 16) |
(*(ptr[2]++) << 8 ) |
(*(ptr[3]++));