aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2022-02-20 17:12:55 +0100
committerPaul B Mahol <onemda@gmail.com>2022-02-20 17:45:50 +0100
commitb15d3db8b6d71145113b6b6263c9d541fe4d5aa4 (patch)
tree741f9be39c890487fda6a06067fd2b405b44440f
parentdf98e8e4b4e735358425542169bbaf5de6c7c767 (diff)
downloadffmpeg-b15d3db8b6d71145113b6b6263c9d541fe4d5aa4.tar.gz
avcodec/wavpack: do not process only first non-zero field of int32info chunk
Fixes bitexact decoding with high bit depth samples.
-rw-r--r--libavcodec/wavpack.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 30790ef16e..b6c782bd54 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -1303,14 +1303,16 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
av_log(avctx, AV_LOG_ERROR,
"Invalid INT32INFO, extra_bits = %d (> 30)\n", val[0]);
continue;
- } else if (val[0]) {
+ } else {
s->extra_bits = val[0];
- } else if (val[1]) {
+ }
+ if (val[1])
s->shift = val[1];
- } else if (val[2]) {
+ if (val[2]) {
s->and = s->or = 1;
s->shift = val[2];
- } else if (val[3]) {
+ }
+ if (val[3]) {
s->and = 1;
s->shift = val[3];
}