[FFmpeg-cvslog] avdevice/dshow: proper cleanup of queried media types

Diederick Niehorster git at videolan.org
Tue Jan 4 14:13:54 EET 2022


ffmpeg | branch: master | Diederick Niehorster <dcnieho at gmail.com> | Sun Jan  2 10:49:37 2022 +0100| [307d2b867f35cb18f9ff6085f7e5298c3f0be278] | committer: Gyan Doshi

avdevice/dshow: proper cleanup of queried media types

Signed-off-by: Diederick Niehorster <dcnieho at gmail.com>
Reviewed-by: Roger Pack <rogerdpack2 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=307d2b867f35cb18f9ff6085f7e5298c3f0be278
---

 libavdevice/dshow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 30f1be1ead..4b6887881d 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -953,7 +953,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
                     av_log(avctx, AV_LOG_INFO, "(%s)", chroma ? chroma : "unknown");
 
                 av_log(avctx, AV_LOG_INFO, "\n");
-                continue;
+                goto next;
             }
             if (requested_video_codec_id != AV_CODEC_ID_RAWVIDEO) {
                 if (requested_video_codec_id != fmt_info->codec_id)
@@ -1038,6 +1038,7 @@ next:
         if (type && type->pbFormat)
             CoTaskMemFree(type->pbFormat);
         CoTaskMemFree(type);
+        type = NULL;
     }
     // previously found a matching VIDEOINFOHEADER format and stored
     // it for safe keeping. Searching further for a matching



More information about the ffmpeg-cvslog mailing list