[FFmpeg-devel] [PATCH 0/2] Animated JPEG XL Encoder

Leo Izen leo.izen at gmail.com
Sat Dec 14 14:58:26 EET 2024


On 12/11/24 5:32 PM, Marth64 wrote:
> Hi Leo,
> 
> In libjxl_anim_encode_frame():
> 
>> +        if (!ctx->prev) {
>> +            ret = AVERROR(ENOMEM);
>> +            goto end;
>> +        }
>> +        ret = ff_encode_get_frame(avctx, ctx->prev);
>> +        if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
>> +            goto end;
>> +        ret = libjxl_preprocess_stream(avctx, ctx->prev, 1);
>> +        if (ret < 0)
>> +            goto end;
> 
> and
> 
>> +    if (ret == AVERROR(EAGAIN))
>> +        goto end;
> 
> As `end` block simply returns ret, can these gotos be eliminated and
> replaced with a return on the spot?

They could be. There use to be a free statement there that was moved, 
and I didn't update the gotos. Good catch!

- Leo Izen (Traneptora)




More information about the ffmpeg-devel mailing list