From: Zhao Zhili <quinkblack-at-foxmail.com@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: [FFmpeg-devel] [RFC] Remove use of av_uninit
Date: Fri, 11 Apr 2025 18:32:48 +0800
Message-ID: <tencent_91DE67ECAAAAD33A5C5C4B9A263650882606@qq.com> (raw)
Background:
1. There is a av_uninit macro which suppress uninitialized variable warning
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__INTEL_COMPILER)
# define av_uninit(x) x=x
#else
# define av_uninit(x) x
#endif
2. Declaration after statement coding style is allowed now
3. There is a crash fixed by ab792634197 which is related to av_uninit, and I have confronted it again recently
commit ab792634197e364ca1bb194f9abe36836e42f12d
Date: Mon Oct 18 12:31:38 2021 +0300
seek: Fix crashes in ff_seek_frame_binary if built with latest Clang 14
------------------------------------------------------------------------
What I suggests:
1. Deprecated av_uninit and removed it in the future
2. Remove usage in current code
3. When there is uninitiated variable warning
a. Declare variable when need if it’s possible, so it can be initiated at the same time
b. Use valid default value if there is
c. If there is no valid default value, or you think the variable never being used uninitialized, assign an insane value and add assert before use if
av_assert1(value != invalid_value);
Note:
1. I’m not suggesting always initialize variables
2. I’m suggesting remove av_uninit, until someone has an idea to make it more useful and less harmful.
Let’s ensure we stay on track and maintain focus on the central issue.
_______________________________________________
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".
next reply other threads:[~2025-04-11 10:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-11 10:32 Zhao Zhili [this message]
2025-04-11 11:24 ` Nicolas George
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=tencent_91DE67ECAAAAD33A5C5C4B9A263650882606@qq.com \
--to=quinkblack-at-foxmail.com@ffmpeg.org \
--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