From d29b12f90ca101e3bece49a6a67ea6da4a168111 Mon Sep 17 00:00:00 2001 From: Sergey Silkin Date: Thu, 15 Dec 2022 14:56:02 +0100 Subject: [PATCH] Free memory allocated by GetStreamCaps Bug: webrtc:14343 Change-Id: I5ac7fee900d27b07bd908f778ffffd0b7d982ca9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/288260 Reviewed-by: Per Kjellander Commit-Queue: Sergey Silkin Cr-Commit-Position: refs/heads/main@{#38945} --- modules/video_capture/windows/video_capture_ds.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/video_capture/windows/video_capture_ds.cc b/modules/video_capture/windows/video_capture_ds.cc index 781fbe9f0a..74b31d98be 100644 --- a/modules/video_capture/windows/video_capture_ds.cc +++ b/modules/video_capture/windows/video_capture_ds.cc @@ -235,8 +235,13 @@ int32_t VideoCaptureDS::SetCameraOutput( // Check if this is a DV camera and we need to add MS DV Filter if (pmt->subtype == MEDIASUBTYPE_dvsl || - pmt->subtype == MEDIASUBTYPE_dvsd || pmt->subtype == MEDIASUBTYPE_dvhd) + pmt->subtype == MEDIASUBTYPE_dvsd || + pmt->subtype == MEDIASUBTYPE_dvhd) { isDVCamera = true; // This is a DV camera. Use MS DV filter + } + + FreeMediaType(pmt); + pmt = NULL; } RELEASE_AND_CLEAR(streamConfig);