Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-07-01 14:39:43 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-07-01 14:40:36 +0300
commit0ea099ad3e6d82a09538ad2c93e193187d70345d (patch)
tree0a899330462e2d45bd6459e62ed8fda7ff655b91 /libavcodec/mpegvideo_enc.c
parent56fd4705c0496bc108ac84c03465d33351d366a5 (diff)
avcodec/mpegvideo_enc: fix undefined shifts in ff_dct_quantize_c()
Fixes: signal_sigsegv_35eac16_2762_cov_2704249783_missing_frames.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index e729d36aa2..7f84bccf2c 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -4559,12 +4559,12 @@ int ff_dct_quantize_c(MpegEncContext *s,
start_i = 1;
last_non_zero = 0;
qmat = n < 4 ? s->q_intra_matrix[qscale] : s->q_chroma_intra_matrix[qscale];
- bias= s->intra_quant_bias<<(QMAT_SHIFT - QUANT_BIAS_SHIFT);
+ bias= s->intra_quant_bias*(1<<(QMAT_SHIFT - QUANT_BIAS_SHIFT));
} else {
start_i = 0;
last_non_zero = -1;
qmat = s->q_inter_matrix[qscale];
- bias= s->inter_quant_bias<<(QMAT_SHIFT - QUANT_BIAS_SHIFT);
+ bias= s->inter_quant_bias*(1<<(QMAT_SHIFT - QUANT_BIAS_SHIFT));
}
threshold1= (1<<QMAT_SHIFT) - bias - 1;
threshold2= (threshold1<<1);