# HG changeset patch # User diego # Date 1229257834 0 # Node ID e9db9859de6cca9c2892682a52d04940dcae7c29 # Parent 0de488aa4fb0e2c5e6288e6f51370efec940eb6c Prevent shift overflow, patch by Anders Grnberg, galileo.m2 gmail com. diff -r 0de488aa4fb0 -r e9db9859de6c imgconvert.c --- a/imgconvert.c Sun Dec 14 12:24:50 2008 +0000 +++ b/imgconvert.c Sun Dec 14 12:30:34 2008 +0000 @@ -784,7 +784,7 @@ dst_pix_fmt = -1; min_dist = 0x7fffffff; 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; if (loss == 0) { dist = avg_bits_per_pixel(i);