On Mon, Jan 05, 2026 at 02:11:46AM +0100, 0xBat via ffmpeg-devel wrote:
> Call avcodec_free_context to release memory if parameters cannot be copied to 
> the context.
> 
> Signed-off-by: 0xBat <[email protected]>
> ---
>  doc/examples/transcode.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/doc/examples/transcode.c b/doc/examples/transcode.c
> index 1dc1b50502..2bbe091b94 100644
> --- a/doc/examples/transcode.c
> +++ b/doc/examples/transcode.c
> @@ -94,9 +94,9 @@ static int open_input_file(const char *filename)
>          }
>          ret = avcodec_parameters_to_context(codec_ctx, stream->codecpar);
>          if (ret < 0) {
> -            av_log(NULL, AV_LOG_ERROR, "Failed to copy decoder parameters to 
> input decoder context "
> -                   "for stream #%u\n", i);
> -            return ret;
> +        av_log(NULL, AV_LOG_ERROR, "Failed to copy decoder parameters to 
> input decoder context for stream #%u\n", i);
> +        avcodec_free_context(&codec_ctx);
> +        return ret;
>          }

Does the indention look correct to you ?

Also can you explain what you are trying to do with the av_log() change here ?

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to