From 8776682d44803abfb217194396ad4fd2b9c33052 Mon Sep 17 00:00:00 2001 From: Dmytro Shynkevych Date: Sun, 4 Oct 2015 17:14:51 -0400 Subject: [PATCH] cameradevice: fixed a major leak: avformat_context not always freed --- src/video/cameradevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/cameradevice.cpp b/src/video/cameradevice.cpp index ab0e6f358..bd4efcf01 100644 --- a/src/video/cameradevice.cpp +++ b/src/video/cameradevice.cpp @@ -225,7 +225,6 @@ QVector> CameraDevice::getRawDeviceListGeneric() if (av_opt_set_dict2(s, &tmp, AV_OPT_SEARCH_CHILDREN) < 0) { av_dict_free(&tmp); - avformat_free_context(s); } avdevice_list_devices(s, &devlist); if (!devlist) @@ -243,6 +242,7 @@ QVector> CameraDevice::getRawDeviceListGeneric() devices[i].second = dev->device_description; } avdevice_free_list_devices(&devlist); + avformat_free_context(s); return devices; }