diff options
author | Manuel Lauss <manuel.lauss@gmail.com> | 2024-11-08 12:51:14 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-11-28 14:39:06 +0100 |
commit | dc98e7989d81fce8201af83dd9bc6e4ef7bea227 (patch) | |
tree | bc5924577901acfedf03c30861e9399c9a41d914 /libavcodec | |
parent | 85fec8d90f3768488c711f23013595100be861f8 (diff) | |
download | ffmpeg-dc98e7989d81fce8201af83dd9bc6e4ef7bea227.tar.gz |
libavcodec/sanm: clear codec47 diff buffers with specific color
The codec47 header provides colors to use to clear the
2 difference buffers. This fixes artifacts (black hair, faces) in
Curse of Monkey Island "CURSERNG.SAN" video.
Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/sanm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 936746ace4..fcf6234d8a 100644 --- a/libavcodec/sanm.c +++ b/libavcodec/sanm.c @@ -915,13 +915,16 @@ static int old_codec47(SANMVideoContext *ctx, int top, uint8_t *dst = (uint8_t *)ctx->frm0 + left + top * stride; uint8_t *prev1 = (uint8_t *)ctx->frm1; uint8_t *prev2 = (uint8_t *)ctx->frm2; + uint8_t auxcol[2]; int tbl_pos = bytestream2_tell(&ctx->gb); int seq = bytestream2_get_le16(&ctx->gb); int compr = bytestream2_get_byte(&ctx->gb); int new_rot = bytestream2_get_byte(&ctx->gb); int skip = bytestream2_get_byte(&ctx->gb); - bytestream2_skip(&ctx->gb, 9); + bytestream2_skip(&ctx->gb, 7); + auxcol[0] = bytestream2_get_byteu(&ctx->gb); + auxcol[1] = bytestream2_get_byteu(&ctx->gb); decoded_size = bytestream2_get_le32(&ctx->gb); bytestream2_skip(&ctx->gb, 8); @@ -937,8 +940,8 @@ static int old_codec47(SANMVideoContext *ctx, int top, } if (!seq) { ctx->prev_seq = -1; - memset(prev1, 0, ctx->height * stride); - memset(prev2, 0, ctx->height * stride); + memset(prev1, auxcol[0], ctx->height * stride); + memset(prev2, auxcol[1], ctx->height * stride); } switch (compr) { |