Commit 20c38c9c authored by Justin Ruggles's avatar Justin Ruggles

swscale: fix some undefined signed left shifts

Based on a patch by Michael Niedermayer <michaelni@gmx.at>
parent 60c4660b
......@@ -1230,13 +1230,13 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
#if HAVE_BIGENDIAN
case AV_PIX_FMT_BGR24:
#endif
c->pal_rgb[i] = (r + (g << 8) + (b << 16)) << 8;
c->pal_rgb[i] = (r << 8) + (g << 16) + ((unsigned)b << 24);
break;
case AV_PIX_FMT_RGB32_1:
#if HAVE_BIGENDIAN
case AV_PIX_FMT_RGB24:
#endif
c->pal_rgb[i] = (b + (g << 8) + (r << 16)) << 8;
c->pal_rgb[i] = (b << 8) + (g << 16) + ((unsigned)r << 24);
break;
case AV_PIX_FMT_RGB32:
#if !HAVE_BIGENDIAN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment