summaryrefslogtreecommitdiff
path: root/libavcodec/imgconvert.c
diff options
context:
space:
mode:
authorAnders Grönberg <galileo.m2@gmail.com>2008-12-14 12:30:34 +0000
committerDiego Biurrun <diego@biurrun.de>2008-12-14 12:30:34 +0000
commit31c3a4dc7e15f993b0076c7231f80249a55ea146 (patch)
tree70e34be1cdf1fd79466238ea92002d2b4fbf79d8 /libavcodec/imgconvert.c
parentcac55c91969158bd07ffcef27753f4edc79fc8ef (diff)
Prevent shift overflow, patch by Anders Grönberg, galileo.m2 gmail com.
Originally committed as revision 16121 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/imgconvert.c')
-rw-r--r--libavcodec/imgconvert.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index 1bee4b13ef..3b6918bf5c 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -784,7 +784,7 @@ static int avcodec_find_best_pix_fmt1(int64_t pix_fmt_mask,
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);