[FFmpeg-devel] [PATCH v2 1/3] avcodec/sanm: ignore unknown codecs in FOBJs

Manuel Lauss manuel.lauss at gmail.com
Tue Feb 11 09:24:47 EET 2025


Don't error out, just ignore unknown codec numbers and pretend
decode succeeded.  This is useful for older LucasArts titles
which stack a lot of different FOBJs with different codecs into
a single frame.  Mark the frame as corrupt though since we
werent' able to decode everything that is supposed to be visible.

Signed-off-by: Manuel Lauss <manuel.lauss at gmail.com>
---
v2: Mark frame as corrupt, suggested by Marton Balint

 libavcodec/sanm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c
index c30095ed32..a4f0a28c7c 100644
--- a/libavcodec/sanm.c
+++ b/libavcodec/sanm.c
@@ -1274,7 +1274,8 @@ static int process_frame_obj(SANMVideoContext *ctx)
         return old_codec48(ctx, w, h);
     default:
         avpriv_request_sample(ctx->avctx, "Subcodec %d", codec);
-        return AVERROR_PATCHWELCOME;
+        ctx->frame->flags |= AV_FRAME_FLAG_CORRUPT;
+        return 0;
     }
 }
 
-- 
2.48.1



More information about the ffmpeg-devel mailing list