From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 04/17] avcodec/dxva2: initialize hr in ff_dxva2_common_end_frame()
Date: Sun, 2 Jun 2024 22:27:55 +0200
Message-ID: <20240602202755.GA2821752@pb2> (raw)
In-Reply-To: <GV1P250MB073789D0A380A62EA7F392B68FFE2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM>
[-- Attachment #1.1: Type: text/plain, Size: 2006 bytes --]
On Sun, Jun 02, 2024 at 09:10:33PM +0200, Andreas Rheinhardt wrote:
> Michael Niedermayer:
> > Fixes: CID1591924 Uninitialized scalar variable
> > Fixes: CID1591938 Uninitialized scalar variable
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> > libavcodec/dxva2.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c
> > index 1a33c8bbac7..22ecd5acafe 100644
> > --- a/libavcodec/dxva2.c
> > +++ b/libavcodec/dxva2.c
> > @@ -906,7 +906,7 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
> > #endif
> > DECODER_BUFFER_DESC *buffer = NULL, *buffer_slice = NULL;
> > int result, runs = 0;
> > - HRESULT hr;
> > + HRESULT hr = -1;
> > unsigned type;
> > FFDXVASharedContext *sctx = DXVA_SHARED_CONTEXT(avctx);
> >
>
> It seems to me that this (and other patches in this set) is not a real
> fix of a bug. These functions are called either with a D3D11 pix fmt or
> with AV_PIX_FMT_DXVA2_VLD, so these variables are initialized before
> their use.
If they are called with another pixel format then its exploitable
maybe that cannot happen currently
But if or if not. Initializing these variables makes the code simply
more robust and also if it happens a NULL is easier to debug than
uninitialized variables. The assumtions that need to be true for
them to be initialized are not entirely trivial.
ill drop the patches from what i wanted to apply currently but i still
think they should be applied.
I can change the commit message if you can suggest something else ?
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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 prev parent reply other threads:[~2024-06-02 20:28 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 02/17] avcodec/dxva2: Initialize ConfigBitstreamRaw Michael Niedermayer
2024-06-02 19:01 ` Michael Niedermayer
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 03/17] avcodec/dxva2: initialize validate Michael Niedermayer
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 04/17] avcodec/dxva2: initialize hr in ff_dxva2_common_end_frame() Michael Niedermayer
2024-06-02 19:10 ` Andreas Rheinhardt
2024-06-02 20:27 ` Michael Niedermayer [this message]
2024-07-07 19:48 ` Michael Niedermayer
2024-08-11 10:48 ` Michael Niedermayer
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 05/17] avcodec/dxva2_*: Initialize dxva_data_ptr Michael Niedermayer
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 06/17] avcodec/mfenc: check IMFSample_ConvertToContiguousBuffer() for failure Michael Niedermayer
2024-07-02 19:14 ` Michael Niedermayer
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 07/17] qsv: Initialize impl_value Michael Niedermayer
2024-05-27 2:41 ` Xiang, Haihao
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 08/17] avcodec/vp8: Check mutex init Michael Niedermayer
2024-06-07 12:00 ` Michael Niedermayer
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 09/17] avcodec/vp8: Check cond init Michael Niedermayer
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 10/17] avdevice/dshow: Remove NULL check on pin Michael Niedermayer
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 11/17] avdevice/dshow: fix badly indented line Michael Niedermayer
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 12/17] avdevice/dshow: Check device_filter_unique_name before use Michael Niedermayer
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 13/17] avdevice/dshow: Check ICaptureGraphBuilder2_SetFiltergraph() for failure Michael Niedermayer
2024-07-02 19:16 ` Michael Niedermayer
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 14/17] avdevice/dshow: Cleanup also on av_log case Michael Niedermayer
2024-07-02 19:20 ` Michael Niedermayer
2024-07-22 17:57 ` Roger Pack
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 15/17] avdevice/dshow: check ff_dshow_pin_ConnectionMediaType() for failure Michael Niedermayer
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 16/17] avdevice/dshow: Initialize 2 pointers Michael Niedermayer
2024-06-02 18:58 ` Michael Niedermayer
2024-06-14 23:25 ` Roger Pack
2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 17/17] avdevice/dshow_filter: Use wcscpy_s() Michael Niedermayer
2024-07-12 22:18 ` Michael Niedermayer
2024-05-26 23:56 ` [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
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=20240602202755.GA2821752@pb2 \
--to=michael@niedermayer.cc \
--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