aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-09-20 00:17:01 +0200
committerPaul B Mahol <onemda@gmail.com>2019-09-26 14:02:56 +0200
commit69473bec6f38fefc9a433d95f8e00de101299592 (patch)
treed38440797148e09b46fc5284282278898da8f7c8 /libavcodec
parent84974c6fb542cf019904016c2165d9a62db9f312 (diff)
downloadffmpeg-69473bec6f38fefc9a433d95f8e00de101299592.tar.gz
avcodec/pcm: Fix undefined shifts
Fixes the acodec-pcm-u16[lb]e FATE-tests. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/pcm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index ffcbccc77d..d9176732d9 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -303,7 +303,7 @@ static av_cold int pcm_decode_close(AVCodecContext *avctx)
#define DECODE(size, endian, src, dst, n, shift, offset) \
for (; n > 0; n--) { \
uint ## size ## _t v = bytestream_get_ ## endian(&src); \
- AV_WN ## size ## A(dst, (v - offset) << shift); \
+ AV_WN ## size ## A(dst, (uint ## size ## _t)(v - offset) << shift); \
dst += size / 8; \
}
@@ -314,7 +314,7 @@ static av_cold int pcm_decode_close(AVCodecContext *avctx)
dst = frame->extended_data[c]; \
for (i = n; i > 0; i--) { \
uint ## size ## _t v = bytestream_get_ ## endian(&src); \
- AV_WN ## size ## A(dst, (v - offset) << shift); \
+ AV_WN ## size ## A(dst, (uint ## size ##_t)(v - offset) << shift); \
dst += size / 8; \
} \
}