aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-15 17:30:10 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-15 17:30:10 +0100
commit0a4808741e523d3b7b214a945fa2bcb59299896e (patch)
tree3d9e85bc9774f92b731276ceeb4fbc6add39e7cb
parent8d54850f33fbd7240934998d43ade3fa732f5537 (diff)
downloadffmpeg-0a4808741e523d3b7b214a945fa2bcb59299896e.tar.gz
avcodec/h264dsp_template: Fix undefined shifts
Found-by: Clang -fsanitize=shift Reported-by: Thierry Foucu <tfoucu@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/h264dsp_template.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/h264dsp_template.c b/libavcodec/h264dsp_template.c
index 4b42af7913..fa110196b2 100644
--- a/libavcodec/h264dsp_template.c
+++ b/libavcodec/h264dsp_template.c
@@ -237,7 +237,7 @@ static av_always_inline av_flatten void FUNCC(h264_loop_filter_chroma)(uint8_t *
xstride >>= sizeof(pixel)-1;
ystride >>= sizeof(pixel)-1;
for( i = 0; i < 4; i++ ) {
- const int tc = ((tc0[i] - 1) << (BIT_DEPTH - 8)) + 1;
+ const int tc = ((tc0[i] - 1U) << (BIT_DEPTH - 8)) + 1;
if( tc <= 0 ) {
pix += inner_iters*ystride;
continue;
@@ -252,7 +252,7 @@ static av_always_inline av_flatten void FUNCC(h264_loop_filter_chroma)(uint8_t *
FFABS( p1 - p0 ) < beta &&
FFABS( q1 - q0 ) < beta ) {
- int delta = av_clip( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );
+ int delta = av_clip( ((q0 - p0) * 4 + (p1 - q1) + 4) >> 3, -tc, tc );
pix[-xstride] = av_clip_pixel( p0 + delta ); /* p0' */
pix[0] = av_clip_pixel( q0 - delta ); /* q0' */