Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH v5] fftools/cmdutils: Avoid crash when opts could not be allocated
Date: Thu, 16 Dec 2021 12:11:44 +0100
Message-ID: <AM7PR03MB6660F3469A6F78F0B46E3C458F779@AM7PR03MB6660.eurprd03.prod.outlook.com> (raw)
In-Reply-To: <20211215024728.85590-1-young_chelsea@163.com>

Yu Yang:
> From: Yu Yang <yuyang14@kuaishou.com>
> 
> If 'opts' could not be allocated, exiting the program to avoid crash when release it. 
> 
> Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
> Signed-off-by: Yu Yang <yuyang14@kuaishou.com>
> ---
>  fftools/cmdutils.c | 2 +-
>  fftools/cmdutils.h | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
> index 3c8e5a82cd..882584e9c2 100644
> --- a/fftools/cmdutils.c
> +++ b/fftools/cmdutils.c
> @@ -2187,7 +2187,7 @@ AVDictionary **setup_find_stream_info_opts(AVFormatContext *s,
>      if (!opts) {
>          av_log(NULL, AV_LOG_ERROR,
>                 "Could not alloc memory for stream options.\n");
> -        return NULL;
> +        exit_program(1);
>      }
>      for (i = 0; i < s->nb_streams; i++)
>          opts[i] = filter_codec_opts(codec_opts, s->streams[i]->codecpar->codec_id,
> diff --git a/fftools/cmdutils.h b/fftools/cmdutils.h
> index 82cda208be..50eed9b13a 100644
> --- a/fftools/cmdutils.h
> +++ b/fftools/cmdutils.h
> @@ -430,8 +430,8 @@ AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
>   * Each dictionary will contain the options from codec_opts which can
>   * be applied to the corresponding stream codec context.
>   *
> - * @return pointer to the created array of dictionaries, NULL if it
> - * cannot be created
> + * @return pointer to the created array of dictionaries.
> + * Calls exit() on failure.
>   */
>  AVDictionary **setup_find_stream_info_opts(AVFormatContext *s,
>                                             AVDictionary *codec_opts);
> 

Applied. Thanks.

- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

           reply	other threads:[~2021-12-16 11:11 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20211215024728.85590-1-young_chelsea@163.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM7PR03MB6660F3469A6F78F0B46E3C458F779@AM7PR03MB6660.eurprd03.prod.outlook.com \
    --to=andreas.rheinhardt@outlook.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git