[FFmpeg-cvslog] avcodec/wavpackenc: Fix undefined shifts
ffmpeg | branch: release/3.2 | Andreas Rheinhardt | Fri Sep 20 00:16:58 2019 +0200| [d86572fc9e158a532f65a5bec99a068ef08b73f2] | committer: Andreas Rheinhardt avcodec/wavpackenc: Fix undefined shifts Fixes ticket #8161 and the acodec-wavpack FATE-test. Signed-off-by: Andreas Rheinhardt (cherry picked from commit 84974c6fb542cf019904016c2165d9a62db9f312) Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d86572fc9e158a532f65a5bec99a068ef08b73f2 --- libavcodec/wavpackenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index 979b92165b..bc896f15e5 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -529,9 +529,9 @@ static int8_t store_weight(int weight) static int restore_weight(int8_t weight) { -int result; +int result = 8 * weight; -if ((result = (int) weight << 3) > 0) +if (result > 0) result += (result + 64) >> 7; return result; @@ -2571,7 +2571,7 @@ static int wavpack_encode_block(WavPackEncodeContext *s, ret = wv_mono(s, samples_l, !s->num_terms, 1); } else { for (i = 0; i < nb_samples; i++) -crc += (crc << 3) + (samples_l[i] << 1) + samples_l[i] + samples_r[i]; +crc += (crc << 3) + ((uint32_t)samples_l[i] << 1) + samples_l[i] + samples_r[i]; if (s->num_passes) ret = wv_stereo(s, samples_l, samples_r, !s->num_terms, 1); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/wavpackenc: Fix undefined shifts
ffmpeg | branch: release/3.3 | Andreas Rheinhardt | Fri Sep 20 00:16:58 2019 +0200| [594dd57af477e0bb04ee1ada5c6ef6934f1e27c6] | committer: Andreas Rheinhardt avcodec/wavpackenc: Fix undefined shifts Fixes ticket #8161 and the acodec-wavpack FATE-test. Signed-off-by: Andreas Rheinhardt (cherry picked from commit 84974c6fb542cf019904016c2165d9a62db9f312) Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=594dd57af477e0bb04ee1ada5c6ef6934f1e27c6 --- libavcodec/wavpackenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index 979b92165b..bc896f15e5 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -529,9 +529,9 @@ static int8_t store_weight(int weight) static int restore_weight(int8_t weight) { -int result; +int result = 8 * weight; -if ((result = (int) weight << 3) > 0) +if (result > 0) result += (result + 64) >> 7; return result; @@ -2571,7 +2571,7 @@ static int wavpack_encode_block(WavPackEncodeContext *s, ret = wv_mono(s, samples_l, !s->num_terms, 1); } else { for (i = 0; i < nb_samples; i++) -crc += (crc << 3) + (samples_l[i] << 1) + samples_l[i] + samples_r[i]; +crc += (crc << 3) + ((uint32_t)samples_l[i] << 1) + samples_l[i] + samples_r[i]; if (s->num_passes) ret = wv_stereo(s, samples_l, samples_r, !s->num_terms, 1); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/wavpackenc: Fix undefined shifts
ffmpeg | branch: release/3.4 | Andreas Rheinhardt | Fri Sep 20 00:16:58 2019 +0200| [7a6c286d1f51e64c6b092c21c588086be92e7667] | committer: Andreas Rheinhardt avcodec/wavpackenc: Fix undefined shifts Fixes ticket #8161 and the acodec-wavpack FATE-test. Signed-off-by: Andreas Rheinhardt (cherry picked from commit 84974c6fb542cf019904016c2165d9a62db9f312) Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7a6c286d1f51e64c6b092c21c588086be92e7667 --- libavcodec/wavpackenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index 979b92165b..bc896f15e5 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -529,9 +529,9 @@ static int8_t store_weight(int weight) static int restore_weight(int8_t weight) { -int result; +int result = 8 * weight; -if ((result = (int) weight << 3) > 0) +if (result > 0) result += (result + 64) >> 7; return result; @@ -2571,7 +2571,7 @@ static int wavpack_encode_block(WavPackEncodeContext *s, ret = wv_mono(s, samples_l, !s->num_terms, 1); } else { for (i = 0; i < nb_samples; i++) -crc += (crc << 3) + (samples_l[i] << 1) + samples_l[i] + samples_r[i]; +crc += (crc << 3) + ((uint32_t)samples_l[i] << 1) + samples_l[i] + samples_r[i]; if (s->num_passes) ret = wv_stereo(s, samples_l, samples_r, !s->num_terms, 1); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/wavpackenc: Fix undefined shifts
ffmpeg | branch: release/4.0 | Andreas Rheinhardt | Fri Sep 20 00:16:58 2019 +0200| [42ae8d5100f9622494b30dd361a9bbd5a9a15a71] | committer: Andreas Rheinhardt avcodec/wavpackenc: Fix undefined shifts Fixes ticket #8161 and the acodec-wavpack FATE-test. Signed-off-by: Andreas Rheinhardt (cherry picked from commit 84974c6fb542cf019904016c2165d9a62db9f312) Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=42ae8d5100f9622494b30dd361a9bbd5a9a15a71 --- libavcodec/wavpackenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index 979b92165b..bc896f15e5 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -529,9 +529,9 @@ static int8_t store_weight(int weight) static int restore_weight(int8_t weight) { -int result; +int result = 8 * weight; -if ((result = (int) weight << 3) > 0) +if (result > 0) result += (result + 64) >> 7; return result; @@ -2571,7 +2571,7 @@ static int wavpack_encode_block(WavPackEncodeContext *s, ret = wv_mono(s, samples_l, !s->num_terms, 1); } else { for (i = 0; i < nb_samples; i++) -crc += (crc << 3) + (samples_l[i] << 1) + samples_l[i] + samples_r[i]; +crc += (crc << 3) + ((uint32_t)samples_l[i] << 1) + samples_l[i] + samples_r[i]; if (s->num_passes) ret = wv_stereo(s, samples_l, samples_r, !s->num_terms, 1); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/wavpackenc: Fix undefined shifts
ffmpeg | branch: release/4.1 | Andreas Rheinhardt | Fri Sep 20 00:16:58 2019 +0200| [3497fd2dd7342257efd3f4e1bc60c7d5d657a65a] | committer: Andreas Rheinhardt avcodec/wavpackenc: Fix undefined shifts Fixes ticket #8161 and the acodec-wavpack FATE-test. Signed-off-by: Andreas Rheinhardt (cherry picked from commit 84974c6fb542cf019904016c2165d9a62db9f312) Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3497fd2dd7342257efd3f4e1bc60c7d5d657a65a --- libavcodec/wavpackenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index 979b92165b..bc896f15e5 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -529,9 +529,9 @@ static int8_t store_weight(int weight) static int restore_weight(int8_t weight) { -int result; +int result = 8 * weight; -if ((result = (int) weight << 3) > 0) +if (result > 0) result += (result + 64) >> 7; return result; @@ -2571,7 +2571,7 @@ static int wavpack_encode_block(WavPackEncodeContext *s, ret = wv_mono(s, samples_l, !s->num_terms, 1); } else { for (i = 0; i < nb_samples; i++) -crc += (crc << 3) + (samples_l[i] << 1) + samples_l[i] + samples_r[i]; +crc += (crc << 3) + ((uint32_t)samples_l[i] << 1) + samples_l[i] + samples_r[i]; if (s->num_passes) ret = wv_stereo(s, samples_l, samples_r, !s->num_terms, 1); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/wavpackenc: Fix undefined shifts
ffmpeg | branch: release/4.2 | Andreas Rheinhardt | Fri Sep 20 00:16:58 2019 +0200| [0605f5c42ab2a1e30906c6c8467887b3ad1f392e] | committer: Andreas Rheinhardt avcodec/wavpackenc: Fix undefined shifts Fixes ticket #8161 and the acodec-wavpack FATE-test. Signed-off-by: Andreas Rheinhardt (cherry picked from commit 84974c6fb542cf019904016c2165d9a62db9f312) > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0605f5c42ab2a1e30906c6c8467887b3ad1f392e --- libavcodec/wavpackenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index 95f4b6530c..0c85fbe374 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -529,9 +529,9 @@ static int8_t store_weight(int weight) static int restore_weight(int8_t weight) { -int result; +int result = 8 * weight; -if ((result = (int) weight << 3) > 0) +if (result > 0) result += (result + 64) >> 7; return result; @@ -2557,7 +2557,7 @@ static int wavpack_encode_block(WavPackEncodeContext *s, ret = wv_mono(s, samples_l, !s->num_terms, 1); } else { for (i = 0; i < nb_samples; i++) -crc += (crc << 3) + (samples_l[i] << 1) + samples_l[i] + samples_r[i]; +crc += (crc << 3) + ((uint32_t)samples_l[i] << 1) + samples_l[i] + samples_r[i]; if (s->num_passes) ret = wv_stereo(s, samples_l, samples_r, !s->num_terms, 1); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/wavpackenc: Fix undefined shifts
ffmpeg | branch: master | Andreas Rheinhardt | Fri Sep 20 00:16:58 2019 +0200| [84974c6fb542cf019904016c2165d9a62db9f312] | committer: Paul B Mahol avcodec/wavpackenc: Fix undefined shifts Fixes ticket #8161 and the acodec-wavpack FATE-test. Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=84974c6fb542cf019904016c2165d9a62db9f312 --- libavcodec/wavpackenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c index 95f4b6530c..0c85fbe374 100644 --- a/libavcodec/wavpackenc.c +++ b/libavcodec/wavpackenc.c @@ -529,9 +529,9 @@ static int8_t store_weight(int weight) static int restore_weight(int8_t weight) { -int result; +int result = 8 * weight; -if ((result = (int) weight << 3) > 0) +if (result > 0) result += (result + 64) >> 7; return result; @@ -2557,7 +2557,7 @@ static int wavpack_encode_block(WavPackEncodeContext *s, ret = wv_mono(s, samples_l, !s->num_terms, 1); } else { for (i = 0; i < nb_samples; i++) -crc += (crc << 3) + (samples_l[i] << 1) + samples_l[i] + samples_r[i]; +crc += (crc << 3) + ((uint32_t)samples_l[i] << 1) + samples_l[i] + samples_r[i]; if (s->num_passes) ret = wv_stereo(s, samples_l, samples_r, !s->num_terms, 1); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".