Commit 2217a224 authored by Michael Niedermayer's avatar Michael Niedermayer

dpxenc: fix signed c99 overflows

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 7a32ab5e
......@@ -105,13 +105,13 @@ static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, uint
for (x = 0; x < avctx->width; x++) {
int value;
if (s->big_endian) {
value = ((AV_RB16(src + 6*x + 4) & 0xFFC0) >> 4)
| ((AV_RB16(src + 6*x + 2) & 0xFFC0) << 6)
| ((AV_RB16(src + 6*x + 0) & 0xFFC0) << 16);
value = ((AV_RB16(src + 6*x + 4) & 0xFFC0U) >> 4)
| ((AV_RB16(src + 6*x + 2) & 0xFFC0U) << 6)
| ((AV_RB16(src + 6*x + 0) & 0xFFC0U) << 16);
} else {
value = ((AV_RL16(src + 6*x + 4) & 0xFFC0) >> 4)
| ((AV_RL16(src + 6*x + 2) & 0xFFC0) << 6)
| ((AV_RL16(src + 6*x + 0) & 0xFFC0) << 16);
value = ((AV_RL16(src + 6*x + 4) & 0xFFC0U) >> 4)
| ((AV_RL16(src + 6*x + 2) & 0xFFC0U) << 6)
| ((AV_RL16(src + 6*x + 0) & 0xFFC0U) << 16);
}
write32(dst, value);
dst += 4;
......
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