[FFmpeg-devel] [PATCH] lavd/avfoundation: Allow to change interleaving of samples on the fly

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Mon Apr 5 19:59:02 EEST 2021


Thilo Borgmann:
> Hi,
> 
> seems like someone at Apple thought its a good idea to allow this inside the framework....
> 
> 
> 
> +            if (block_buffer_size > ctx->audio_buffer_size) {
> +                ctx->audio_buffer_size = block_buffer_size;
> +                ctx->audio_buffer      = av_realloc(ctx->audio_buffer, block_buffer_size);
> +                if (!ctx->audio_buffer) {
> +                    av_log(s, AV_LOG_ERROR, "error allocating audio buffer\n");
> +                    return 1;
> +                }
>              }

Leak on error; furthermore setting the new size before it has been
successfully allocated is probably not good.
(Not commenting on the rest of the patch.)

- Andreas


More information about the ffmpeg-devel mailing list