Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it
@ 2024-05-26 23:52 Michael Niedermayer
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 02/17] avcodec/dxva2: Initialize ConfigBitstreamRaw Michael Niedermayer
                   ` (16 more replies)
  0 siblings, 17 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: CID1591878 Uninitialized scalar variable
Fixes: CID1591928 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/dxva2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c
index 6eb66c02e40..75ca84d0fe0 100644
--- a/libavcodec/dxva2.c
+++ b/libavcodec/dxva2.c
@@ -806,7 +806,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx,
                            unsigned type, const void *data, unsigned size,
                            unsigned mb_count)
 {
-    void     *dxva_data;
+    void     *dxva_data = NULL;
     unsigned dxva_size;
     int      result;
     HRESULT hr = 0;
@@ -828,7 +828,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx,
                type, (unsigned)hr);
         return -1;
     }
-    if (size <= dxva_size) {
+    if (dxva_data && size <= dxva_size) {
         memcpy(dxva_data, data, size);
 
 #if CONFIG_D3D11VA
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 02/17] avcodec/dxva2: Initialize ConfigBitstreamRaw
  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 ` 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
                   ` (15 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: CID1591894 Uninitialized scalar variable
Fixes: CID1591906 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 75ca84d0fe0..550369ba51f 100644
--- a/libavcodec/dxva2.c
+++ b/libavcodec/dxva2.c
@@ -118,7 +118,7 @@ static int dxva_get_decoder_configuration(AVCodecContext *avctx,
 
     for (i = 0; i < cfg_count; i++) {
         unsigned score;
-        UINT ConfigBitstreamRaw;
+        UINT ConfigBitstreamRaw = 0;
         GUID guidConfigBitstreamEncryption;
 
 #if CONFIG_D3D11VA
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 03/17] avcodec/dxva2: initialize validate
  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-05-26 23:52 ` Michael Niedermayer
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 04/17] avcodec/dxva2: initialize hr in ff_dxva2_common_end_frame() Michael Niedermayer
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: CID1591915 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 550369ba51f..1a33c8bbac7 100644
--- a/libavcodec/dxva2.c
+++ b/libavcodec/dxva2.c
@@ -269,7 +269,7 @@ static int dxva_get_decoder_guid(AVCodecContext *avctx, void *service, void *sur
     *decoder_guid = ff_GUID_NULL;
     for (i = 0; dxva_modes[i].guid; i++) {
         const dxva_mode *mode = &dxva_modes[i];
-        int validate;
+        int validate = 0;
         if (!dxva_check_codec_compatibility(avctx, mode))
             continue;
 
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 04/17] avcodec/dxva2: initialize hr in ff_dxva2_common_end_frame()
  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-05-26 23:52 ` [FFmpeg-devel] [PATCH 03/17] avcodec/dxva2: initialize validate Michael Niedermayer
@ 2024-05-26 23:52 ` Michael Niedermayer
  2024-06-02 19:10   ` Andreas Rheinhardt
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 05/17] avcodec/dxva2_*: Initialize dxva_data_ptr Michael Niedermayer
                   ` (13 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

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);
 
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 05/17] avcodec/dxva2_*: Initialize dxva_data_ptr
  2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
                   ` (2 preceding siblings ...)
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 04/17] avcodec/dxva2: initialize hr in ff_dxva2_common_end_frame() Michael Niedermayer
@ 2024-05-26 23:52 ` Michael Niedermayer
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 06/17] avcodec/mfenc: check IMFSample_ConvertToContiguousBuffer() for failure Michael Niedermayer
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: CID1591888 Uninitialized scalar variable
Fixes: CID1591925 Uninitialized pointer read
Fixes: CID1591933 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/dxva2_av1.c   | 4 ++--
 libavcodec/dxva2_hevc.c  | 5 ++++-
 libavcodec/dxva2_mpeg2.c | 5 ++++-
 libavcodec/dxva2_vc1.c   | 5 ++++-
 libavcodec/dxva2_vp9.c   | 4 ++--
 5 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/libavcodec/dxva2_av1.c b/libavcodec/dxva2_av1.c
index 1b555106599..ea97fcb87e5 100644
--- a/libavcodec/dxva2_av1.c
+++ b/libavcodec/dxva2_av1.c
@@ -354,7 +354,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
     const AV1DecContext *h = avctx->priv_data;
     AVDXVAContext *ctx = DXVA_CONTEXT(avctx);
     struct av1_dxva2_picture_context *ctx_pic = h->cur_frame.hwaccel_picture_private;
-    void     *dxva_data_ptr;
+    void     *dxva_data_ptr = NULL;
     uint8_t  *dxva_data;
     unsigned dxva_size;
     unsigned padding;
@@ -382,7 +382,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
 
     dxva_data = dxva_data_ptr;
 
-    if (ctx_pic->bitstream_size > dxva_size) {
+    if (!dxva_data || ctx_pic->bitstream_size > dxva_size) {
         av_log(avctx, AV_LOG_ERROR, "Bitstream size exceeds hardware buffer");
         return -1;
     }
diff --git a/libavcodec/dxva2_hevc.c b/libavcodec/dxva2_hevc.c
index 31d74a7164d..5eb166c3075 100644
--- a/libavcodec/dxva2_hevc.c
+++ b/libavcodec/dxva2_hevc.c
@@ -248,7 +248,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
     const HEVCFrame *current_picture = h->ref;
     struct hevc_dxva2_picture_context *ctx_pic = current_picture->hwaccel_picture_private;
     DXVA_Slice_HEVC_Short *slice = NULL;
-    void     *dxva_data_ptr;
+    void     *dxva_data_ptr = NULL;
     uint8_t  *dxva_data, *current, *end;
     unsigned dxva_size;
     void     *slice_data;
@@ -278,6 +278,9 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
     }
 #endif
 
+    if (!dxva_data_ptr)
+        return -1;
+
     dxva_data = dxva_data_ptr;
     current = dxva_data;
     end = dxva_data + dxva_size;
diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c
index d31a8bb8724..5de062e5308 100644
--- a/libavcodec/dxva2_mpeg2.c
+++ b/libavcodec/dxva2_mpeg2.c
@@ -160,7 +160,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
         s->current_picture_ptr->hwaccel_picture_private;
     const int is_field = s->picture_structure != PICT_FRAME;
     const unsigned mb_count = s->mb_width * (s->mb_height >> is_field);
-    void     *dxva_data_ptr;
+    void     *dxva_data_ptr = NULL;
     uint8_t  *dxva_data, *current, *end;
     unsigned dxva_size;
     unsigned i;
@@ -186,6 +186,9 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
     }
 #endif
 
+    if (!dxva_data_ptr)
+        return -1;
+
     dxva_data = dxva_data_ptr;
     current = dxva_data;
     end = dxva_data + dxva_size;
diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c
index f7513b2b153..04f26ddff66 100644
--- a/libavcodec/dxva2_vc1.c
+++ b/libavcodec/dxva2_vc1.c
@@ -197,7 +197,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
     const unsigned start_code_size = avctx->codec_id == AV_CODEC_ID_VC1 ? sizeof(start_code) : 0;
     const unsigned mb_count = s->mb_width * (s->mb_height >> v->field_mode);
     DXVA_SliceInfo *slice = NULL;
-    void     *dxva_data_ptr;
+    void     *dxva_data_ptr = NULL;
     uint8_t  *dxva_data, *current, *end;
     unsigned dxva_size;
     unsigned padding;
@@ -224,6 +224,9 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
     }
 #endif
 
+    if (!dxva_data_ptr)
+        return -1;
+
     dxva_data = dxva_data_ptr;
     current = dxva_data;
     end = dxva_data + dxva_size;
diff --git a/libavcodec/dxva2_vp9.c b/libavcodec/dxva2_vp9.c
index ca8b3b136da..f4ab91c580b 100644
--- a/libavcodec/dxva2_vp9.c
+++ b/libavcodec/dxva2_vp9.c
@@ -172,7 +172,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
     const VP9SharedContext *h = avctx->priv_data;
     AVDXVAContext *ctx = DXVA_CONTEXT(avctx);
     struct vp9_dxva2_picture_context *ctx_pic = h->frames[CUR_FRAME].hwaccel_picture_private;
-    void     *dxva_data_ptr;
+    void     *dxva_data_ptr = NULL;
     uint8_t  *dxva_data;
     unsigned dxva_size;
     unsigned padding;
@@ -200,7 +200,7 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx,
 
     dxva_data = dxva_data_ptr;
 
-    if (ctx_pic->slice.SliceBytesInBuffer > dxva_size) {
+    if (!dxva_data || ctx_pic->slice.SliceBytesInBuffer > dxva_size) {
         av_log(avctx, AV_LOG_ERROR, "Failed to build bitstream");
         return -1;
     }
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 06/17] avcodec/mfenc: check IMFSample_ConvertToContiguousBuffer() for failure
  2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
                   ` (3 preceding siblings ...)
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 05/17] avcodec/dxva2_*: Initialize dxva_data_ptr Michael Niedermayer
@ 2024-05-26 23:52 ` 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
                   ` (11 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: CID1591911 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/mfenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c
index 2c68adbdc73..b8f8a25f434 100644
--- a/libavcodec/mfenc.c
+++ b/libavcodec/mfenc.c
@@ -249,7 +249,7 @@ static int mf_sample_to_avpacket(AVCodecContext *avctx, IMFSample *sample, AVPac
     if ((ret = ff_get_encode_buffer(avctx, avpkt, len, 0)) < 0)
         return ret;
 
-    IMFSample_ConvertToContiguousBuffer(sample, &buffer);
+    hr = IMFSample_ConvertToContiguousBuffer(sample, &buffer);
     if (FAILED(hr))
         return AVERROR_EXTERNAL;
 
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 07/17] qsv: Initialize impl_value
  2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
                   ` (4 preceding siblings ...)
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 06/17] avcodec/mfenc: check IMFSample_ConvertToContiguousBuffer() for failure Michael Niedermayer
@ 2024-05-26 23:52 ` 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
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

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

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();
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 08/17] avcodec/vp8: Check mutex init
  2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
                   ` (5 preceding siblings ...)
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 07/17] qsv: Initialize impl_value Michael Niedermayer
@ 2024-05-26 23:52 ` 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
                   ` (9 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: CID1598556 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/vp8.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 8e91613068a..3e1f67172ae 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -247,7 +247,11 @@ int update_dimensions(VP8Context *s, int width, int height, int is_vp7)
             return AVERROR(ENOMEM);
         }
 #if HAVE_THREADS
-        pthread_mutex_init(&s->thread_data[i].lock, NULL);
+        ret = pthread_mutex_init(&s->thread_data[i].lock, NULL);
+        if (ret) {
+            free_buffers(s);
+            return AVERROR(ret);
+        }
         pthread_cond_init(&s->thread_data[i].cond, NULL);
 #endif
     }
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 09/17] avcodec/vp8: Check cond init
  2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
                   ` (6 preceding siblings ...)
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 08/17] avcodec/vp8: Check mutex init Michael Niedermayer
@ 2024-05-26 23:52 ` Michael Niedermayer
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 10/17] avdevice/dshow: Remove NULL check on pin Michael Niedermayer
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: CID1598563 Unchecked return value

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/vp8.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 3e1f67172ae..d6df018655c 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -252,7 +252,11 @@ int update_dimensions(VP8Context *s, int width, int height, int is_vp7)
             free_buffers(s);
             return AVERROR(ret);
         }
-        pthread_cond_init(&s->thread_data[i].cond, NULL);
+        ret = pthread_cond_init(&s->thread_data[i].cond, NULL);
+        if (ret) {
+            free_buffers(s);
+            return AVERROR(ret);
+        }
 #endif
     }
 
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 10/17] avdevice/dshow: Remove NULL check on pin
  2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
                   ` (7 preceding siblings ...)
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 09/17] avcodec/vp8: Check cond init Michael Niedermayer
@ 2024-05-26 23:52 ` Michael Niedermayer
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 11/17] avdevice/dshow: fix badly indented line Michael Niedermayer
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

The pointer is used before the check

Fixes: CID1591884 Dereference before null check

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavdevice/dshow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 0330d1d0b6c..8942c0c499a 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -432,8 +432,8 @@ dshow_get_device_media_types(AVFormatContext *avctx, enum dshowDeviceType devtyp
             IEnumMediaTypes_Release(types);
         if (p)
             IKsPropertySet_Release(p);
-        if (pin)
-            IPin_Release(pin);
+
+        IPin_Release(pin);
     }
 
     IEnumPins_Release(pins);
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 11/17] avdevice/dshow: fix badly indented line
  2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
                   ` (8 preceding siblings ...)
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 10/17] avdevice/dshow: Remove NULL check on pin Michael Niedermayer
@ 2024-05-26 23:52 ` Michael Niedermayer
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 12/17] avdevice/dshow: Check device_filter_unique_name before use Michael Niedermayer
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavdevice/dshow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 8942c0c499a..fd9027b1787 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -1370,7 +1370,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum,
             goto error;
         }
     }
-        if (ctx->device_filter[otherDevType]) {
+    if (ctx->device_filter[otherDevType]) {
         // avoid adding add two instances of the same device to the graph, one for video, one for audio
         // a few devices don't support this (could also do this check earlier to avoid double crossbars, etc. but they seem OK)
         if (strcmp(device_filter_unique_name, ctx->device_unique_name[otherDevType]) == 0) {
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 12/17] avdevice/dshow: Check device_filter_unique_name before use
  2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
                   ` (9 preceding siblings ...)
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 11/17] avdevice/dshow: fix badly indented line Michael Niedermayer
@ 2024-05-26 23:52 ` Michael Niedermayer
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 13/17] avdevice/dshow: Check ICaptureGraphBuilder2_SetFiltergraph() for failure Michael Niedermayer
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: CID1591931 Explicit null dereferenced

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavdevice/dshow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index fd9027b1787..911b0ecc078 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -1373,7 +1373,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum,
     if (ctx->device_filter[otherDevType]) {
         // avoid adding add two instances of the same device to the graph, one for video, one for audio
         // a few devices don't support this (could also do this check earlier to avoid double crossbars, etc. but they seem OK)
-        if (strcmp(device_filter_unique_name, ctx->device_unique_name[otherDevType]) == 0) {
+        if (!device_filter_unique_name || strcmp(device_filter_unique_name, ctx->device_unique_name[otherDevType]) == 0) {
           av_log(avctx, AV_LOG_DEBUG, "reusing previous graph capture filter... %s\n", device_filter_unique_name);
           IBaseFilter_Release(device_filter);
           device_filter = ctx->device_filter[otherDevType];
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 13/17] avdevice/dshow: Check ICaptureGraphBuilder2_SetFiltergraph() for failure
  2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
                   ` (10 preceding siblings ...)
  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 ` 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
                   ` (4 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: CID1591939 Logically dead code

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavdevice/dshow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 911b0ecc078..557cf33161e 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -1465,7 +1465,7 @@ dshow_open_device(AVFormatContext *avctx, ICreateDevEnum *devenum,
         av_log(avctx, AV_LOG_ERROR, "Could not create CaptureGraphBuilder2\n");
         goto error;
     }
-    ICaptureGraphBuilder2_SetFiltergraph(graph_builder2, graph);
+    r = ICaptureGraphBuilder2_SetFiltergraph(graph_builder2, graph);
     if (r != S_OK) {
         av_log(avctx, AV_LOG_ERROR, "Could not set graph for CaptureGraphBuilder2\n");
         goto error;
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 14/17] avdevice/dshow: Cleanup also on av_log case
  2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
                   ` (11 preceding siblings ...)
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 13/17] avdevice/dshow: Check ICaptureGraphBuilder2_SetFiltergraph() for failure Michael Niedermayer
@ 2024-05-26 23:52 ` Michael Niedermayer
  2024-07-02 19:20   ` Michael Niedermayer
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 15/17] avdevice/dshow: check ff_dshow_pin_ConnectionMediaType() for failure Michael Niedermayer
                   ` (3 subsequent siblings)
  16 siblings, 1 reply; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: CID1598550 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavdevice/dshow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 557cf33161e..645c33ea2e6 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -1001,7 +1001,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
                     "  ch=%2u, bits=%2u, rate=%6lu\n",
                     fx->nChannels, fx->wBitsPerSample, fx->nSamplesPerSec
                 );
-                continue;
+                goto next;
             }
             if (
                 (requested_sample_rate && requested_sample_rate != fx->nSamplesPerSec) ||
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 15/17] avdevice/dshow: check ff_dshow_pin_ConnectionMediaType() for failure
  2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
                   ` (12 preceding siblings ...)
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 14/17] avdevice/dshow: Cleanup also on av_log case Michael Niedermayer
@ 2024-05-26 23:52 ` Michael Niedermayer
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 16/17] avdevice/dshow: Initialize 2 pointers Michael Niedermayer
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Maybe Fixes: CID1598557 Explicit null dereferenced

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavdevice/dshow.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 645c33ea2e6..403e56fe135 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -1546,7 +1546,10 @@ dshow_add_device(AVFormatContext *avctx,
 
     ctx->capture_filter[devtype]->stream_index = st->index;
 
-    ff_dshow_pin_ConnectionMediaType(ctx->capture_pin[devtype], &type);
+    if (ff_dshow_pin_ConnectionMediaType(ctx->capture_pin[devtype], &type) != S_OK) {
+        ret = AVERROR(EIO);
+        goto error;
+    }
     fmt_info = dshow_get_format_info(&type);
     if (!fmt_info) {
         ret = AVERROR(EIO);
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 16/17] avdevice/dshow: Initialize 2 pointers
  2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
                   ` (13 preceding siblings ...)
  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 ` Michael Niedermayer
  2024-06-02 18:58   ` Michael Niedermayer
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 17/17] avdevice/dshow_filter: Use wcscpy_s() Michael Niedermayer
  2024-05-26 23:56 ` [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
  16 siblings, 1 reply; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Coverity claims these are used uninitilaized in CID1598561 Uninitialized pointer write and CID1598565 Uninitialized pointer write

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavdevice/dshow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 403e56fe135..5947096cb29 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -898,8 +898,8 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
 
         if (devtype == VideoDevice) {
             VIDEO_STREAM_CONFIG_CAPS *vcaps = caps;
-            BITMAPINFOHEADER *bih;
-            int64_t *fr;
+            BITMAPINFOHEADER *bih = NULL;
+            int64_t *fr = NULL;
 #if DSHOWDEBUG
             ff_print_VIDEO_STREAM_CONFIG_CAPS(vcaps);
 #endif
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [FFmpeg-devel] [PATCH 17/17] avdevice/dshow_filter: Use wcscpy_s()
  2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
                   ` (14 preceding siblings ...)
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 16/17] avdevice/dshow: Initialize 2 pointers Michael Niedermayer
@ 2024-05-26 23:52 ` 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
  16 siblings, 1 reply; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:52 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Fixes: CID1591929 Copy into fixed size buffer

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavdevice/dshow_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/dshow_filter.c b/libavdevice/dshow_filter.c
index 4642ac077c5..2122c846262 100644
--- a/libavdevice/dshow_filter.c
+++ b/libavdevice/dshow_filter.c
@@ -135,7 +135,7 @@ long WINAPI ff_dshow_filter_JoinFilterGraph(DShowFilter *this, IFilterGraph *gra
 
     this->info.pGraph = graph;
     if (name)
-        wcscpy(this->info.achName, name);
+        wcscpy_s(this->info.achName, sizeof(this->info.achName) / sizeof(wchar_t), name);
 
     return S_OK;
 }
-- 
2.45.1

_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it
  2024-05-26 23:52 [FFmpeg-devel] [PATCH 01/17] avcodec/dxva2: Initialize dxva_size and check it Michael Niedermayer
                   ` (15 preceding siblings ...)
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 17/17] avdevice/dshow_filter: Use wcscpy_s() Michael Niedermayer
@ 2024-05-26 23:56 ` Michael Niedermayer
  16 siblings, 0 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-05-26 23:56 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 693 bytes --]

On Mon, May 27, 2024 at 01:52:13AM +0200, Michael Niedermayer wrote:
> Fixes: CID1591878 Uninitialized scalar variable
> Fixes: CID1591928 Uninitialized pointer read
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/dxva2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Also all the dshow, windows, dxva ... stuff is untested due to lack of a box with such OS
so the respective patches should be reviewed with that in mind!

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator

[-- 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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 07/17] qsv: Initialize impl_value
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 07/17] qsv: Initialize impl_value Michael Niedermayer
@ 2024-05-27  2:41   ` Xiang, Haihao
  0 siblings, 0 replies; 32+ messages in thread
From: Xiang, Haihao @ 2024-05-27  2:41 UTC (permalink / raw)
  To: ffmpeg-devel

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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 16/17] avdevice/dshow: Initialize 2 pointers
  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
  0 siblings, 1 reply; 32+ messages in thread
From: Michael Niedermayer @ 2024-06-02 18:58 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 604 bytes --]

On Mon, May 27, 2024 at 01:52:28AM +0200, Michael Niedermayer wrote:
> Coverity claims these are used uninitilaized in CID1598561 Uninitialized pointer write and CID1598565 Uninitialized pointer write
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavdevice/dshow.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

will apply

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is a danger to trust the dream we wish for rather than
the science we have, -- Dr. Kenneth Brown

[-- 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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 02/17] avcodec/dxva2: Initialize ConfigBitstreamRaw
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 02/17] avcodec/dxva2: Initialize ConfigBitstreamRaw Michael Niedermayer
@ 2024-06-02 19:01   ` Michael Niedermayer
  0 siblings, 0 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-06-02 19:01 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 543 bytes --]

On Mon, May 27, 2024 at 01:52:14AM +0200, Michael Niedermayer wrote:
> Fixes: CID1591894 Uninitialized scalar variable
> Fixes: CID1591906 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(-)

will apply patches 2-4

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.

[-- 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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 04/17] avcodec/dxva2: initialize hr in ff_dxva2_common_end_frame()
  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
  0 siblings, 1 reply; 32+ messages in thread
From: Andreas Rheinhardt @ 2024-06-02 19:10 UTC (permalink / raw)
  To: ffmpeg-devel

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.

- 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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 04/17] avcodec/dxva2: initialize hr in ff_dxva2_common_end_frame()
  2024-06-02 19:10   ` Andreas Rheinhardt
@ 2024-06-02 20:27     ` Michael Niedermayer
  2024-07-07 19:48       ` Michael Niedermayer
  0 siblings, 1 reply; 32+ messages in thread
From: Michael Niedermayer @ 2024-06-02 20:27 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- 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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 08/17] avcodec/vp8: Check mutex init
  2024-05-26 23:52 ` [FFmpeg-devel] [PATCH 08/17] avcodec/vp8: Check mutex init Michael Niedermayer
@ 2024-06-07 12:00   ` Michael Niedermayer
  0 siblings, 0 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-06-07 12:00 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 514 bytes --]

On Mon, May 27, 2024 at 01:52:20AM +0200, Michael Niedermayer wrote:
> Fixes: CID1598556 Unchecked return value
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/vp8.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

will apply the vp8 patches of this set

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope

[-- 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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 16/17] avdevice/dshow: Initialize 2 pointers
  2024-06-02 18:58   ` Michael Niedermayer
@ 2024-06-14 23:25     ` Roger Pack
  0 siblings, 0 replies; 32+ messages in thread
From: Roger Pack @ 2024-06-14 23:25 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Sun, Jun 2, 2024 at 12:58 PM Michael Niedermayer
<michael@niedermayer.cc> wrote:
>
> On Mon, May 27, 2024 at 01:52:28AM +0200, Michael Niedermayer wrote:
> > Coverity claims these are used uninitilaized in CID1598561 Uninitialized pointer write and CID1598565 Uninitialized pointer write
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavdevice/dshow.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
>
> will apply

They seemed to LGTM.
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 06/17] avcodec/mfenc: check IMFSample_ConvertToContiguousBuffer() for failure
  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
  0 siblings, 0 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-07-02 19:14 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 507 bytes --]

On Mon, May 27, 2024 at 01:52:18AM +0200, Michael Niedermayer wrote:
> Fixes: CID1591911 Logically dead code
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavcodec/mfenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is a danger to trust the dream we wish for rather than
the science we have, -- Dr. Kenneth Brown

[-- 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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 13/17] avdevice/dshow: Check ICaptureGraphBuilder2_SetFiltergraph() for failure
  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
  0 siblings, 0 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-07-02 19:16 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 502 bytes --]

On Mon, May 27, 2024 at 01:52:25AM +0200, Michael Niedermayer wrote:
> Fixes: CID1591939 Logically dead code
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavdevice/dshow.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates

[-- 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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 14/17] avdevice/dshow: Cleanup also on av_log case
  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
  0 siblings, 1 reply; 32+ messages in thread
From: Michael Niedermayer @ 2024-07-02 19:20 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: rogerdpack


[-- Attachment #1.1: Type: text/plain, Size: 715 bytes --]

On Mon, May 27, 2024 at 01:52:26AM +0200, Michael Niedermayer wrote:
> Fixes: CID1598550 Resource leak
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavdevice/dshow.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

can someone with a clue about and means to test dshow review the dshow
patches of this set ?
i dont feel comfortable to just apply some of these with no testing
and no review

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.

[-- 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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 04/17] avcodec/dxva2: initialize hr in ff_dxva2_common_end_frame()
  2024-06-02 20:27     ` Michael Niedermayer
@ 2024-07-07 19:48       ` Michael Niedermayer
  2024-08-11 10:48         ` Michael Niedermayer
  0 siblings, 1 reply; 32+ messages in thread
From: Michael Niedermayer @ 2024-07-07 19:48 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 2190 bytes --]

On Sun, Jun 02, 2024 at 10:27:55PM +0200, Michael Niedermayer wrote:
> 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 ?

ping
does anyone object to the patches ?
does someone want a different commit message ? if so which ?

I will mark these issues as false positives, as they technically are

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

You can kill me, but you cannot change the truth.

[-- 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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 17/17] avdevice/dshow_filter: Use wcscpy_s()
  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
  0 siblings, 0 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-07-12 22:18 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 535 bytes --]

On Mon, May 27, 2024 at 01:52:29AM +0200, Michael Niedermayer wrote:
> Fixes: CID1591929 Copy into fixed size buffer
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavdevice/dshow_filter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin

[-- 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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 14/17] avdevice/dshow: Cleanup also on av_log case
  2024-07-02 19:20   ` Michael Niedermayer
@ 2024-07-22 17:57     ` Roger Pack
  0 siblings, 0 replies; 32+ messages in thread
From: Roger Pack @ 2024-07-22 17:57 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Tue, Jul 2, 2024 at 1:39 PM Michael Niedermayer
<michael@niedermayer.cc> wrote:
>
> On Mon, May 27, 2024 at 01:52:26AM +0200, Michael Niedermayer wrote:
> > Fixes: CID1598550 Resource leak
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >  libavdevice/dshow.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
>
> can someone with a clue about and means to test dshow review the dshow
> patches of this set ?
> i dont feel comfortable to just apply some of these with no testing
> and no review

They seem to not have broken anything, thanks for looking into it! :)
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [FFmpeg-devel] [PATCH 04/17] avcodec/dxva2: initialize hr in ff_dxva2_common_end_frame()
  2024-07-07 19:48       ` Michael Niedermayer
@ 2024-08-11 10:48         ` Michael Niedermayer
  0 siblings, 0 replies; 32+ messages in thread
From: Michael Niedermayer @ 2024-08-11 10:48 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 2488 bytes --]

On Sun, Jul 07, 2024 at 09:48:40PM +0200, Michael Niedermayer wrote:
> On Sun, Jun 02, 2024 at 10:27:55PM +0200, Michael Niedermayer wrote:
> > 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 ?
> 
> ping
> does anyone object to the patches ?
> does someone want a different commit message ? if so which ?

apparently noone cares so i will apply them with the "fixed" replaced
by "related" or something like that

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Some people wanted to paint the bikeshed green, some blue and some pink.
People argued and fought, when they finally agreed, only rust was left.

[-- 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".

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2024-08-11 10:48 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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