aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-14 22:51:57 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-15 12:25:47 +0100
commit0c9ad1c746e3a8ccb7c6f292e10c8017c0a9dc3b (patch)
tree778801937b8410f75038bb48e34bb092c84af2ba
parentf4103876f90f3eb68b64a5015ed3a3a158e82883 (diff)
downloadffmpeg-0c9ad1c746e3a8ccb7c6f292e10c8017c0a9dc3b.tar.gz
avcodec/snowenc: Fix 2 undefined shifts
Fixes: Ticket7990 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 8802e329c8317ca5ceb929df48a23eb0f9e852b2) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/snowenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 0d800b9f49..4e51e18e1f 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -311,7 +311,7 @@ static int encode_q_branch(SnowContext *s, int level, int x, int y){
if(P_LEFT[1] > (c->ymax<<shift)) P_LEFT[1] = (c->ymax<<shift);
if(P_TOP[0] > (c->xmax<<shift)) P_TOP[0] = (c->xmax<<shift);
if(P_TOP[1] > (c->ymax<<shift)) P_TOP[1] = (c->ymax<<shift);
- if(P_TOPRIGHT[0] < (c->xmin<<shift)) P_TOPRIGHT[0]= (c->xmin<<shift);
+ if(P_TOPRIGHT[0] < (c->xmin * (1<<shift))) P_TOPRIGHT[0]= (c->xmin * (1<<shift));
if(P_TOPRIGHT[0] > (c->xmax<<shift)) P_TOPRIGHT[0]= (c->xmax<<shift); //due to pmx no clip
if(P_TOPRIGHT[1] > (c->ymax<<shift)) P_TOPRIGHT[1]= (c->ymax<<shift);
@@ -1782,7 +1782,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
}else{
for(y=0; y<h; y++){
for(x=0; x<w; x++){
- s->spatial_dwt_buffer[y*w + x]=s->spatial_idwt_buffer[y*w + x]<<ENCODER_EXTRA_BITS;
+ s->spatial_dwt_buffer[y*w + x]= s->spatial_idwt_buffer[y*w + x] * (1 << ENCODER_EXTRA_BITS);
}
}
}