diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-14 05:17:13 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-14 05:26:31 +0400 |
commit | b12d92efd6c0d48665383a9baecc13e7ebbd8a22 (patch) | |
tree | 2e1493948ffac773901d9d737fd0cd8b468d02f8 /libavcodec | |
parent | d3d715ff134555570d7e2c2aa15aad50f6c6fdbd (diff) |
avoid "0xFF << 24" as it is considered a integer overflow in C99
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avs.c | 2 | ||||
-rw-r--r-- | libavcodec/bfi.c | 2 | ||||
-rw-r--r-- | libavcodec/bmv.c | 2 | ||||
-rw-r--r-- | libavcodec/cdgraphics.c | 2 | ||||
-rw-r--r-- | libavcodec/dfa.c | 2 | ||||
-rw-r--r-- | libavcodec/dxa.c | 2 | ||||
-rw-r--r-- | libavcodec/eacmv.c | 2 | ||||
-rw-r--r-- | libavcodec/eatgv.c | 2 | ||||
-rw-r--r-- | libavcodec/flicvideo.c | 2 | ||||
-rw-r--r-- | libavcodec/jvdec.c | 2 | ||||
-rw-r--r-- | libavcodec/kmvc.c | 2 | ||||
-rw-r--r-- | libavcodec/mmvideo.c | 2 | ||||
-rw-r--r-- | libavcodec/mss1.c | 2 | ||||
-rw-r--r-- | libavcodec/mss12.c | 2 | ||||
-rw-r--r-- | libavcodec/pngdec.c | 4 | ||||
-rw-r--r-- | libavcodec/qdrw.c | 2 | ||||
-rw-r--r-- | libavcodec/rl2.c | 2 | ||||
-rw-r--r-- | libavcodec/sanm.c | 8 | ||||
-rw-r--r-- | libavcodec/smacker.c | 2 | ||||
-rw-r--r-- | libavcodec/tiertexseqv.c | 2 | ||||
-rw-r--r-- | libavcodec/tiff.c | 4 | ||||
-rw-r--r-- | libavcodec/vmdav.c | 2 | ||||
-rw-r--r-- | libavcodec/vqavideo.c | 2 | ||||
-rw-r--r-- | libavcodec/yop.c | 2 |
24 files changed, 29 insertions, 29 deletions
diff --git a/libavcodec/avs.c b/libavcodec/avs.c index a9ab029fd7..4b05bf9400 100644 --- a/libavcodec/avs.c +++ b/libavcodec/avs.c @@ -87,7 +87,7 @@ avs_decode_frame(AVCodecContext * avctx, buf += 4; for (i=first; i<last; i++, buf+=3) { pal[i] = (buf[0] << 18) | (buf[1] << 10) | (buf[2] << 2); - pal[i] |= 0xFF << 24 | (pal[i] >> 6) & 0x30303; + pal[i] |= 0xFFU << 24 | (pal[i] >> 6) & 0x30303; } sub_type = buf[0]; diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c index 8d7aa13c3b..f7df68e527 100644 --- a/libavcodec/bfi.c +++ b/libavcodec/bfi.c @@ -82,7 +82,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, void *data, pal = (uint32_t *)bfi->frame.data[1]; for (i = 0; i < avctx->extradata_size / 3; i++) { int shift = 16; - *pal = 0xFF << 24; + *pal = 0xFFU << 24; for (j = 0; j < 3; j++, shift -= 8) *pal += ((avctx->extradata[i * 3 + j] << 2) | (avctx->extradata[i * 3 + j] >> 4)) << shift; diff --git a/libavcodec/bmv.c b/libavcodec/bmv.c index 48e950838f..a345ea4c99 100644 --- a/libavcodec/bmv.c +++ b/libavcodec/bmv.c @@ -227,7 +227,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac return AVERROR_INVALIDDATA; } for (i = 0; i < 256; i++) - c->pal[i] = 0xFF << 24 | bytestream_get_be24(&c->stream); + c->pal[i] = 0xFFU << 24 | bytestream_get_be24(&c->stream); } if (type & BMV_SCROLL) { if (c->stream - pkt->data > pkt->size - 2) { diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c index 91b2d9072b..1f666fc363 100644 --- a/libavcodec/cdgraphics.c +++ b/libavcodec/cdgraphics.c @@ -126,7 +126,7 @@ static void cdg_load_palette(CDGraphicsContext *cc, uint8_t *data, int low) r = ((color >> 8) & 0x000F) * 17; g = ((color >> 4) & 0x000F) * 17; b = ((color ) & 0x000F) * 17; - palette[i + array_offset] = 0xFF << 24 | r << 16 | g << 8 | b; + palette[i + array_offset] = 0xFFU << 24 | r << 16 | g << 8 | b; } cc->frame.palette_has_changed = 1; } diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c index 8156c3766b..94a4265362 100644 --- a/libavcodec/dfa.c +++ b/libavcodec/dfa.c @@ -345,7 +345,7 @@ static int dfa_decode_frame(AVCodecContext *avctx, pal_elems = FFMIN(chunk_size / 3, 256); for (i = 0; i < pal_elems; i++) { s->pal[i] = bytestream2_get_be24(&gb) << 2; - s->pal[i] |= 0xFF << 24 | (s->pal[i] >> 6) & 0x30303; + s->pal[i] |= 0xFFU << 24 | (s->pal[i] >> 6) & 0x30303; } s->pic.palette_has_changed = 1; } else if (chunk_type <= 9) { diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index 215519573e..13b63df926 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -209,7 +209,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac r = *buf++; g = *buf++; b = *buf++; - c->pal[i] = 0xFF << 24 | r << 16 | g << 8 | b; + c->pal[i] = 0xFFU << 24 | r << 16 | g << 8 | b; } pc = 1; buf_size -= 768+4; diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c index 4960011838..d3de7cac29 100644 --- a/libavcodec/eacmv.c +++ b/libavcodec/eacmv.c @@ -142,7 +142,7 @@ static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t buf += 16; for (i=pal_start; i<pal_start+pal_count && i<AVPALETTE_COUNT && buf_end - buf >= 3; i++) { - s->palette[i] = 0xFF << 24 | AV_RB24(buf); + s->palette[i] = 0xFFU << 24 | AV_RB24(buf); buf += 3; } } diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c index 45f9fc774b..69e74ca2a4 100644 --- a/libavcodec/eatgv.c +++ b/libavcodec/eatgv.c @@ -286,7 +286,7 @@ static int tgv_decode_frame(AVCodecContext *avctx, pal_count = AV_RL16(&buf[6]); buf += 12; for(i=0; i<pal_count && i<AVPALETTE_COUNT && buf_end - buf >= 3; i++) { - s->palette[i] = 0xFF << 24 | AV_RB24(buf); + s->palette[i] = 0xFFU << 24 | AV_RB24(buf); buf += 3; } } diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c index 79695da4ef..0514b7528f 100644 --- a/libavcodec/flicvideo.c +++ b/libavcodec/flicvideo.c @@ -256,7 +256,7 @@ static int flic_decode_frame_8BPP(AVCodecContext *avctx, r = bytestream2_get_byte(&g2) << color_shift; g = bytestream2_get_byte(&g2) << color_shift; b = bytestream2_get_byte(&g2) << color_shift; - entry = 0xFF << 24 | r << 16 | g << 8 | b; + entry = 0xFFU << 24 | r << 16 | g << 8 | b; if (color_shift == 2) entry |= entry >> 6 & 0x30303; if (s->palette[palette_ptr] != entry) diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c index cec28cceae..976ce08db2 100644 --- a/libavcodec/jvdec.c +++ b/libavcodec/jvdec.c @@ -177,7 +177,7 @@ static int decode_frame(AVCodecContext *avctx, if (buf_end - buf >= AVPALETTE_COUNT * 3) { for (i = 0; i < AVPALETTE_COUNT; i++) { uint32_t pal = AV_RB24(buf); - s->palette[i] = 0xFF << 24 | pal << 2 | ((pal >> 4) & 0x30303); + s->palette[i] = 0xFFU << 24 | pal << 2 | ((pal >> 4) & 0x30303); buf += 3; } s->palette_has_changed = 1; diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c index 59ae9f2672..34545947b2 100644 --- a/libavcodec/kmvc.c +++ b/libavcodec/kmvc.c @@ -389,7 +389,7 @@ static av_cold int decode_init(AVCodecContext * avctx) c->prev = c->frm1; for (i = 0; i < 256; i++) { - c->pal[i] = 0xFF << 24 | i * 0x10101; + c->pal[i] = 0xFFU << 24 | i * 0x10101; } if (avctx->extradata_size < 12) { diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c index 28975e8912..b51d4fed6a 100644 --- a/libavcodec/mmvideo.c +++ b/libavcodec/mmvideo.c @@ -72,7 +72,7 @@ static int mm_decode_pal(MmContext *s) bytestream2_skip(&s->gb, 4); for (i = 0; i < 128; i++) { - s->palette[i] = 0xFF << 24 | bytestream2_get_be24(&s->gb); + s->palette[i] = 0xFFU << 24 | bytestream2_get_be24(&s->gb); s->palette[i+128] = s->palette[i]<<2; } diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c index 660dd89709..6a55b4fbfe 100644 --- a/libavcodec/mss1.c +++ b/libavcodec/mss1.c @@ -129,7 +129,7 @@ static int decode_pal(MSS12Context *ctx, ArithCoder *acoder) r = arith_get_bits(acoder, 8); g = arith_get_bits(acoder, 8); b = arith_get_bits(acoder, 8); - *pal++ = (0xFF << 24) | (r << 16) | (g << 8) | b; + *pal++ = (0xFFU << 24) | (r << 16) | (g << 8) | b; } return !!ncol; diff --git a/libavcodec/mss12.c b/libavcodec/mss12.c index b8df225822..59294b8b14 100644 --- a/libavcodec/mss12.c +++ b/libavcodec/mss12.c @@ -645,7 +645,7 @@ av_cold int ff_mss12_decode_init(MSS12Context *c, int version, } for (i = 0; i < 256; i++) - c->pal[i] = 0xFF << 24 | AV_RB24(avctx->extradata + 52 + + c->pal[i] = 0xFFU << 24 | AV_RB24(avctx->extradata + 52 + (version ? 8 : 0) + i * 3); c->mask_stride = FFALIGN(avctx->width, 16); diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 4a6047e11a..a75420b144 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -592,10 +592,10 @@ static int decode_frame(AVCodecContext *avctx, r = bytestream2_get_byte(&s->gb); g = bytestream2_get_byte(&s->gb); b = bytestream2_get_byte(&s->gb); - s->palette[i] = (0xff << 24) | (r << 16) | (g << 8) | b; + s->palette[i] = (0xFFU << 24) | (r << 16) | (g << 8) | b; } for(;i<256;i++) { - s->palette[i] = (0xff << 24); + s->palette[i] = (0xFFU << 24); } s->state |= PNG_PLTE; bytestream2_skip(&s->gb, 4); /* crc */ diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c index 55fc930ceb..ab4c6c154c 100644 --- a/libavcodec/qdrw.c +++ b/libavcodec/qdrw.c @@ -91,7 +91,7 @@ static int decode_frame(AVCodecContext *avctx, buf++; b = *buf++; buf++; - pal[idx] = 0xFF << 24 | r << 16 | g << 8 | b; + pal[idx] = 0xFFU << 24 | r << 16 | g << 8 | b; } p->palette_has_changed = 1; diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c index 96041a6d55..5cffd52901 100644 --- a/libavcodec/rl2.c +++ b/libavcodec/rl2.c @@ -154,7 +154,7 @@ static av_cold int rl2_decode_init(AVCodecContext *avctx) /** initialize palette */ for(i=0;i<AVPALETTE_COUNT;i++) - s->palette[i] = 0xFF << 24 | AV_RB24(&avctx->extradata[6 + i * 3]); + s->palette[i] = 0xFFU << 24 | AV_RB24(&avctx->extradata[6 + i * 3]); /** decode background frame if present */ back_size = avctx->extradata_size - EXTRADATA1_SIZE; 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)); } diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index fa4812c6d8..0291061e99 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -388,7 +388,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac smk->pic.pict_type = AV_PICTURE_TYPE_P; for(i = 0; i < 256; i++) - *pal++ = 0xFF << 24 | bytestream2_get_be24u(&gb2); + *pal++ = 0xFFU << 24 | bytestream2_get_be24u(&gb2); last_reset(smk->mmap_tbl, smk->mmap_last); last_reset(smk->mclr_tbl, smk->mclr_last); diff --git a/libavcodec/tiertexseqv.c b/libavcodec/tiertexseqv.c index e6bf0fdaa7..62b7eeb25d 100644 --- a/libavcodec/tiertexseqv.c +++ b/libavcodec/tiertexseqv.c @@ -178,7 +178,7 @@ static int seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int for (i = 0; i < 256; i++) { for (j = 0; j < 3; j++, data++) c[j] = (*data << 2) | (*data >> 4); - palette[i] = 0xFF << 24 | AV_RB24(c); + palette[i] = 0xFFU << 24 | AV_RB24(c); } seq->frame.palette_has_changed = 1; } diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index ed4670f23e..ad0b0bae5a 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -607,7 +607,7 @@ static int init_image(TiffContext *s) /* make default grayscale pal */ pal = (uint32_t *) s->picture.data[1]; for (i = 0; i < 1<<s->bpp; i++) - pal[i] = 0xFF << 24 | i * 255 / ((1<<s->bpp) - 1) * 0x010101; + pal[i] = 0xFFU << 24 | i * 255 / ((1<<s->bpp) - 1) * 0x010101; } } return 0; @@ -824,7 +824,7 @@ static int tiff_decode_tag(TiffContext *s) for (k = 2; k >= 0; k--) { for (i = 0; i < count / 3; i++) { if (k == 2) - pal[i] = 0xff << 24; + pal[i] = 0xFFU << 24; j = (tget(&s->gb, type, s->le) >> off) << (k * 8); pal[i] |= j; } diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c index b0599b99a9..2b298fedef 100644 --- a/libavcodec/vmdav.c +++ b/libavcodec/vmdav.c @@ -265,7 +265,7 @@ static void vmd_decode(VmdVideoContext *s) r = *p++ * 4; g = *p++ * 4; b = *p++ * 4; - palette32[i] = 0xFF << 24 | r << 16 | g << 8 | b; + palette32[i] = 0xFFU << 24 | r << 16 | g << 8 | b; palette32[i] |= palette32[i] >> 6 & 0x30303; } } diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c index 93a602edc5..76465195ea 100644 --- a/libavcodec/vqavideo.c +++ b/libavcodec/vqavideo.c @@ -416,7 +416,7 @@ static int vqa_decode_chunk(VqaContext *s) r = bytestream2_get_byteu(&s->gb) * 4; g = bytestream2_get_byteu(&s->gb) * 4; b = bytestream2_get_byteu(&s->gb) * 4; - s->palette[i] = 0xFF << 24 | r << 16 | g << 8 | b; + s->palette[i] = 0xFFU << 24 | r << 16 | g << 8 | b; s->palette[i] |= s->palette[i] >> 6 & 0x30303; } } diff --git a/libavcodec/yop.c b/libavcodec/yop.c index 3e27c1fe27..21036284b2 100644 --- a/libavcodec/yop.c +++ b/libavcodec/yop.c @@ -235,7 +235,7 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size, palette[i + firstcolor] = (s->srcptr[0] << 18) | (s->srcptr[1] << 10) | (s->srcptr[2] << 2); - palette[i + firstcolor] |= 0xFF << 24 | + palette[i + firstcolor] |= 0xFFU << 24 | (palette[i + firstcolor] >> 6) & 0x30303; } |