diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-06-26 09:52:10 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-06-26 09:54:30 +0200 |
commit | 6eff2772843067b3dfb615b112744346d546ae40 (patch) | |
tree | 04c9f58a24bdf0a0090ea79a5f614621dd94ab36 /libavcodec/sanm.c | |
parent | c77bcbbb3223101ab6984d00d23389012c0c4514 (diff) | |
download | ffmpeg-6eff2772843067b3dfb615b112744346d546ae40.tar.gz |
Make LucasArts Smush SANM palette opaque.
Reviewed-by: Paul B Mahol
Diffstat (limited to 'libavcodec/sanm.c')
-rw-r--r-- | libavcodec/sanm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 777f693e49..f5de6a26aa 100644 --- a/libavcodec/sanm.c +++ b/libavcodec/sanm.c @@ -283,7 +283,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ctx->subversion = AV_RL16(avctx->extradata); for (i = 0; i < 256; i++) - ctx->pal[i] = AV_RL32(avctx->extradata + 2 + i * 4); + ctx->pal[i] = 0xFF << 24 | AV_RL32(avctx->extradata + 2 + i * 4); } return 0; @@ -1163,7 +1163,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; } for (i = 0; i < 256; i++) - ctx->pal[i] = bytestream2_get_be24u(&ctx->gb); + ctx->pal[i] = 0xFF << 24 | bytestream2_get_be24u(&ctx->gb); break; case MKBETAG('F', 'O', 'B', 'J'): if (size < 16) @@ -1181,7 +1181,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] = AV_RB24(tmp); + ctx->pal[i] = 0xFF << 24 | AV_RB24(tmp); } } else { if (size < 768 * 2 + 4) { @@ -1194,7 +1194,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] = bytestream2_get_be24u(&ctx->gb); + ctx->pal[i] = 0xFF << 24 | bytestream2_get_be24u(&ctx->gb); } else { memset(ctx->pal, 0, sizeof(ctx->pal)); } |