Mercurial > libavcodec.hg
comparison imgconvert.c @ 8321:e9db9859de6c libavcodec
Prevent shift overflow, patch by Anders Grnberg, galileo.m2 gmail com.
author | diego |
---|---|
date | Sun, 14 Dec 2008 12:30:34 +0000 |
parents | 589f9a71df95 |
children | 7768bdfd4f7b |
comparison
equal
deleted
inserted
replaced
8320:0de488aa4fb0 | 8321:e9db9859de6c |
---|---|
782 | 782 |
783 /* find exact color match with smallest size */ | 783 /* find exact color match with smallest size */ |
784 dst_pix_fmt = -1; | 784 dst_pix_fmt = -1; |
785 min_dist = 0x7fffffff; | 785 min_dist = 0x7fffffff; |
786 for(i = 0;i < PIX_FMT_NB; i++) { | 786 for(i = 0;i < PIX_FMT_NB; i++) { |
787 if (pix_fmt_mask & (1 << i)) { | 787 if (pix_fmt_mask & (1ULL << i)) { |
788 loss = avcodec_get_pix_fmt_loss(i, src_pix_fmt, has_alpha) & loss_mask; | 788 loss = avcodec_get_pix_fmt_loss(i, src_pix_fmt, has_alpha) & loss_mask; |
789 if (loss == 0) { | 789 if (loss == 0) { |
790 dist = avg_bits_per_pixel(i); | 790 dist = avg_bits_per_pixel(i); |
791 if (dist < min_dist) { | 791 if (dist < min_dist) { |
792 min_dist = dist; | 792 min_dist = dist; |