[FFmpeg-devel] [PATCH 2/2] lavfi/f_sendcmd: clear Command on alloc failure
Marvin Scholz
epirat07 at gmail.com
Wed Apr 23 00:15:11 EEST 2025
On 30 Jan 2025, at 1:25, Marvin Scholz wrote:
> If the command array failed to allocate, the current parsed
> Command has to be cleared, else memory allocated for it
> would be leaked.
>
> Fix CID 1638635
> ---
I intend to push the set in a few days, if no one has comments or objections.
> libavfilter/f_sendcmd.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/libavfilter/f_sendcmd.c b/libavfilter/f_sendcmd.c
> index 8a0c368108..64f284f4f1 100644
> --- a/libavfilter/f_sendcmd.c
> +++ b/libavfilter/f_sendcmd.c
> @@ -263,6 +263,7 @@ static int parse_commands(Command **cmds, int *nb_cmds, int interval_count,
> if (!*cmds) {
> av_log(log_ctx, AV_LOG_ERROR,
> "Could not (re)allocate command array\n");
> + clear_command(&cmd);
> return AVERROR(ENOMEM);
> }
> }
> --
> 2.39.5 (Apple Git-154)
More information about the ffmpeg-devel
mailing list