Prevent shift overflow, patch by Anders Grönberg, galileo.m2 gmail com.

Originally committed as revision 16121 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Anders Grönberg 2008-12-14 12:30:34 +00:00 committed by Diego Biurrun
parent cac55c9196
commit 31c3a4dc7e
1 changed files with 1 additions and 1 deletions

View File

@ -784,7 +784,7 @@ static int avcodec_find_best_pix_fmt1(int64_t pix_fmt_mask,
dst_pix_fmt = -1; dst_pix_fmt = -1;
min_dist = 0x7fffffff; min_dist = 0x7fffffff;
for(i = 0;i < PIX_FMT_NB; i++) { for(i = 0;i < PIX_FMT_NB; i++) {
if (pix_fmt_mask & (1 << i)) { if (pix_fmt_mask & (1ULL << i)) {
loss = avcodec_get_pix_fmt_loss(i, src_pix_fmt, has_alpha) & loss_mask; loss = avcodec_get_pix_fmt_loss(i, src_pix_fmt, has_alpha) & loss_mask;
if (loss == 0) { if (loss == 0) {
dist = avg_bits_per_pixel(i); dist = avg_bits_per_pixel(i);