codec3 is codec1 which writes zero values instead of skipping them. This fixes a lot of RA1 videos.
Unified · Split
| @@ -558,7 +558,7 @@ static int rle_decode(SANMVideoContext *ctx, uint8_t *dst, const int out_size) · 557 unmodified lines | ||
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | static int old_codec1(SANMVideoContext *ctx, int top, |
| 561 | − int left, int width, int height) | |
| 561 | + int left, int width, int height, int opaque) | |
| 562 | 562 | { |
| 563 | 563 | int i, j, len, flag, code, val, end, pxoff; |
| 564 | 564 | const int maxpxo = ctx->height * ctx->pitch; |
| @@ -581,7 +581,7 @@ static int old_codec1(SANMVideoContext *ctx, int top, · 16 unmodified lines | ||
| 581 | 581 | code = (code >> 1) + 1; |
| 582 | 582 | if (flag) { |
| 583 | 583 | val = bytestream2_get_byteu(&ctx->gb); |
| 584 | − if (val) { | |
| 584 | + if (val || opaque) { | |
| 585 | 585 | for (j = 0; j < code; j++) { |
| 586 | 586 | if (pxoff >= 0 && pxoff < maxpxo) |
| 587 | 587 | *(dst + pxoff) = val; |
| @@ -595,7 +595,7 @@ static int old_codec1(SANMVideoContext *ctx, int top, · 7 unmodified lines | ||
| 595 | 595 | return AVERROR_INVALIDDATA; |
| 596 | 596 | for (j = 0; j < code; j++) { |
| 597 | 597 | val = bytestream2_get_byteu(&ctx->gb); |
| 598 | − if ((pxoff >= 0) && (pxoff < maxpxo) && val) | |
| 598 | + if ((pxoff >= 0) && (pxoff < maxpxo) && (val || opaque)) | |
| 599 | 599 | *(dst + pxoff) = val; |
| 600 | 600 | pxoff++; |
| 601 | 601 | } |
| @@ -1312,7 +1312,7 @@ static int process_frame_obj(SANMVideoContext *ctx) · 710 unmodified lines | ||
| 1312 | 1312 | switch (codec) { |
| 1313 | 1313 | case 1: |
| 1314 | 1314 | case 3: |
| 1315 | − return old_codec1(ctx, top, left, w, h); | |
| 1315 | + return old_codec1(ctx, top, left, w, h, codec == 3); | |
| 1316 | 1316 | case 37: |
| 1317 | 1317 | return old_codec37(ctx, w, h); |
| 1318 | 1318 | case 47: |