Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Paul B Mahol <onemda@gmail.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Cc: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] avformat: Add check for ff_get_extradata
Date: Tue, 22 Feb 2022 10:30:04 +0100
Message-ID: <CAPYw7P7cRPQH_vHVW=2nsj8eyOFxUS=L62tbqTUsHYqXd06-=Q@mail.gmail.com> (raw)
In-Reply-To: <20220222091446.2788957-1-jiasheng@iscas.ac.cn>

On Tue, Feb 22, 2022 at 10:14 AM Jiasheng Jiang <jiasheng@iscas.ac.cn>
wrote:

> On Tue, Feb 22, 2022 at 04:10:51PM +0800, Paul B Mahol wrote:
>
> >> As the potential failure of the memory allocation, the
> ff_get_extradata()
> >> could return error if fails.
> >> Therefore, it should be better to deal with the return value of the
> >> ff_get_extradata() and return error if fails.
> >>
> >
> >
> > Not really necessary. Does not fix anything.
>
> It is true that the 'extradata' could be NULL and have not used.
> But I have checked many other callers of the ff_get_extradata(),
> such as avi_read_header() in `libavformat/avidec.c`.
> They all have checked the return value to guarantee the 'extradata'
> to be non-NULL.
> That means in the future, if the 'aix->extradata' is used, the programmer
> may not notice that 'aix->extradata' is especial and needs to be checked
> before use.
> Therefore, I think it is necessary to add the check to guarantee the
> consisitency of the code.
>

Nope, that does not make sense, it should always be checked.


>
> Thanks,
> Jiang
>
>
_______________________________________________
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:[~2022-02-22  9:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22  9:14 Jiasheng Jiang
2022-02-22  9:30 ` Paul B Mahol [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-02-22  7:49 Jiasheng Jiang
2022-02-22  8:10 ` Paul B Mahol

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='CAPYw7P7cRPQH_vHVW=2nsj8eyOFxUS=L62tbqTUsHYqXd06-=Q@mail.gmail.com' \
    --to=onemda@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    --cc=jiasheng@iscas.ac.cn \
    /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