aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-09-20 00:17:01 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-03 14:13:49 +0200
commitf4bcf5742e930384fa32616437c7ab8c65e19357 (patch)
tree60fb77d6e4b509c06500275466607fb627db1f94
parent594dd57af477e0bb04ee1ada5c6ef6934f1e27c6 (diff)
downloadffmpeg-f4bcf5742e930384fa32616437c7ab8c65e19357.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> (cherry picked from commit 69473bec6f38fefc9a433d95f8e00de101299592) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavcodec/pcm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 8c326c6829..a2caf0367f 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -290,7 +290,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; \
}
@@ -301,7 +301,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; \
} \
}