diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-09-20 00:17:01 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-07-03 16:16:48 +0200 |
commit | 5b71c06acb7ac1bff2a539a33abac94508085ce8 (patch) | |
tree | 7573782642186cef15202c4b003ab2471a30c9ce | |
parent | d86572fc9e158a532f65a5bec99a068ef08b73f2 (diff) | |
download | ffmpeg-5b71c06acb7ac1bff2a539a33abac94508085ce8.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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index 4272f4cd48..1670d0fe92 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -271,7 +271,7 @@ static av_cold int pcm_decode_init(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; \ } @@ -282,7 +282,7 @@ static av_cold int pcm_decode_init(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; \ } \ } |