[FFmpeg-devel] [PATCH] libavforamt/udp: Memory allocation failure check

Marton Balint cus at passwd.hu
Thu Mar 9 00:44:35 EET 2023



On Fri, 3 Mar 2023, jackarain wrote:

> Signed-off-by: jackarain <jack.wgm at gmail.com>
> ---
> libavformat/udp.c | 4 ++++
> 1 file changed, 4 insertions(+)

Thanks, will apply.

Regards,
Marton

>
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index e8980b29d8..909213a467 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -740,6 +740,10 @@ static int udp_open(URLContext *h, const char *uri, int flags)
>         if (av_find_info_tag(buf, sizeof(buf), "localaddr", p)) {
>             av_freep(&s->localaddr);
>             s->localaddr = av_strdup(buf);
> +            if (!s->localaddr) {
> +                ret = AVERROR(ENOMEM);
> +                goto fail;
> +            }
>         }
>         if (av_find_info_tag(buf, sizeof(buf), "sources", p)) {
>             if ((ret = ff_ip_parse_sources(h, buf, &s->filters)) < 0)
> -- 
> 2.39.2
>
> _______________________________________________
> 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