summaryrefslogtreecommitdiff
path: root/libavcodec/sanm.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-14 03:17:13 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-14 03:26:31 +0200
commitb12d92efd6c0d48665383a9baecc13e7ebbd8a22 (patch)
tree2e1493948ffac773901d9d737fd0cd8b468d02f8 /libavcodec/sanm.c
parentd3d715ff134555570d7e2c2aa15aad50f6c6fdbd (diff)
downloadffmpeg-b12d92efd6c0d48665383a9baecc13e7ebbd8a22.tar.gz
avoid "0xFF << 24" as it is considered a integer overflow in C99
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/sanm.c')
-rw-r--r--libavcodec/sanm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c
index c39d269a41..766ac68e71 100644
--- a/libavcodec/sanm.c
+++ b/libavcodec/sanm.c
@@ -284,7 +284,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
ctx->subversion = AV_RL16(avctx->extradata);
for (i = 0; i < 256; i++)
- ctx->pal[i] = 0xFF << 24 | AV_RL32(avctx->extradata + 2 + i * 4);
+ ctx->pal[i] = 0xFFU << 24 | AV_RL32(avctx->extradata + 2 + i * 4);
}
return 0;
@@ -1172,7 +1172,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
return AVERROR_INVALIDDATA;
}
for (i = 0; i < 256; i++)
- ctx->pal[i] = 0xFF << 24 | bytestream2_get_be24u(&ctx->gb);
+ ctx->pal[i] = 0xFFU << 24 | bytestream2_get_be24u(&ctx->gb);
break;
case MKBETAG('F', 'O', 'B', 'J'):
if (size < 16)
@@ -1190,7 +1190,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
int t = (ctx->pal[i] >> (16 - j * 8)) & 0xFF;
tmp[j] = av_clip_uint8((t * 129 + ctx->delta_pal[i * 3 + j]) >> 7);
}
- ctx->pal[i] = 0xFF << 24 | AV_RB24(tmp);
+ ctx->pal[i] = 0xFFU << 24 | AV_RB24(tmp);
}
} else {
if (size < 768 * 2 + 4) {
@@ -1203,7 +1203,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
ctx->delta_pal[i] = bytestream2_get_le16u(&ctx->gb);
if (size >= 768 * 5 + 4) {
for (i = 0; i < 256; i++)
- ctx->pal[i] = 0xFF << 24 | bytestream2_get_be24u(&ctx->gb);
+ ctx->pal[i] = 0xFFU << 24 | bytestream2_get_be24u(&ctx->gb);
} else {
memset(ctx->pal, 0, sizeof(ctx->pal));
}