diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 7c3e3dc6f6..89966a8b61 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]++));