diff mbox series

[FFmpeg-devel,10/17] avdevice/dshow: Remove NULL check on pin

Message ID 20240526235230.2876318-10-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,01/17] avcodec/dxva2: Initialize dxva_size and check it | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer May 26, 2024, 11:52 p.m. UTC
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 mbox series

Patch

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