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

Marton Balint cus at passwd.hu
Mon Feb 10 21:42:37 EET 2025



On Mon, 10 Feb 2025, Manuel Lauss wrote:

> 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.
>
> Signed-off-by: Manuel Lauss <manuel.lauss at gmail.com>
> ---
> libavcodec/sanm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c
> index c30095ed32..37d2c915d4 100644
> --- a/libavcodec/sanm.c
> +++ b/libavcodec/sanm.c
> @@ -1274,7 +1274,7 @@ 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;
> +        return 0;

But if there is an unsupported FOBJ code that means that the frame might 
be only partially decoded, right? So you should set AV_FRAME_FLAG_CORRUPT 
flag in AVFrame->flags, and still log the error, not silently ignore it.

Regards,
Marton


>     }
> }
>
> -- 
> 2.48.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-devel mailing list