From: "Xiang, Haihao" <haihao.xiang-at-intel.com@ffmpeg.org> To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH 07/17] qsv: Initialize impl_value Date: Mon, 27 May 2024 02:41:08 +0000 Message-ID: <3420d6248217b4bdec53467e1a5f464876709844.camel@intel.com> (raw) In-Reply-To: <20240526235230.2876318-7-michael@niedermayer.cc> On Ma, 2024-05-27 at 01:52 +0200, Michael Niedermayer wrote: > Fixes: The warnings from CID1598553 Uninitialized scalar variable > > Passing partly initialized structs is ugly and asking for hard to reproduce > bugs, > I do not know if this actually fixes a bug or just avoids the uninitialized > fields LGTM, it might avoid issue in the future. Fortunately the uninitialized field is not used in the corresponding function call. Thanks Haihao > > Sponsored-by: Sovereign Tech Fund > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavcodec/qsv.c | 2 +- > libavutil/hwcontext_qsv.c | 8 ++++---- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c > index 6bbfe2a5a95..0c6fbd0dc09 100644 > --- a/libavcodec/qsv.c > +++ b/libavcodec/qsv.c > @@ -496,7 +496,7 @@ static int qsv_new_mfx_loader(AVCodecContext *avctx, > mfxStatus sts; > mfxLoader loader = NULL; > mfxConfig cfg; > - mfxVariant impl_value; > + mfxVariant impl_value = {0}; > > loader = MFXLoad(); > if (!loader) { > diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c > index f3d919daea1..7cec3474786 100644 > --- a/libavutil/hwcontext_qsv.c > +++ b/libavutil/hwcontext_qsv.c > @@ -839,7 +839,7 @@ static int qsv_d3d11_update_config(void *ctx, mfxHDL > handle, mfxConfig cfg) > IDXGIDevice *pDXGIDevice = NULL; > HRESULT hr; > ID3D11Device *device = handle; > - mfxVariant impl_value; > + mfxVariant impl_value = {0}; > > hr = ID3D11Device_QueryInterface(device, &IID_IDXGIDevice, > (void**)&pDXGIDevice); > if (SUCCEEDED(hr)) { > @@ -913,7 +913,7 @@ static int qsv_d3d9_update_config(void *ctx, mfxHDL > handle, mfxConfig cfg) > LUID luid; > D3DDEVICE_CREATION_PARAMETERS params; > HRESULT hr; > - mfxVariant impl_value; > + mfxVariant impl_value = {0}; > > hr = IDirect3DDeviceManager9_OpenDeviceHandle(devmgr, &device_handle); > if (FAILED(hr)) { > @@ -995,7 +995,7 @@ static int qsv_va_update_config(void *ctx, mfxHDL handle, > mfxConfig cfg) > VADisplayAttribute attr = { > .type = VADisplayPCIID, > }; > - mfxVariant impl_value; > + mfxVariant impl_value = {0}; > > vas = vaGetDisplayAttributes(dpy, &attr, 1); > if (vas == VA_STATUS_SUCCESS && attr.flags != > VA_DISPLAY_ATTRIB_NOT_SUPPORTED) { > @@ -1036,7 +1036,7 @@ static int qsv_new_mfx_loader(void *ctx, > mfxStatus sts; > mfxLoader loader = NULL; > mfxConfig cfg; > - mfxVariant impl_value; > + mfxVariant impl_value = {0}; > > *ploader = NULL; > loader = MFXLoad(); _______________________________________________ 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-05-27 2:41 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 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 [this message] 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=3420d6248217b4bdec53467e1a5f464876709844.camel@intel.com \ --to=haihao.xiang-at-intel.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