From: Edward Hervey Date: Sat, 12 Nov 2022 09:40:22 +0000 (+0100) Subject: validate: Don't leak discoverer information X-Git-Tag: 1.22.0~456 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3f95779c30ce379dafe69e0888790dc8f363341c;p=platform%2Fupstream%2Fgstreamer.git validate: Don't leak discoverer information The various streaminfo were being overwritten without being unreffed first Part-of: --- diff --git a/subprojects/gst-devtools/validate/gst/validate/media-descriptor-writer.c b/subprojects/gst-devtools/validate/gst/validate/media-descriptor-writer.c index 95b3512..66fcb03 100644 --- a/subprojects/gst-devtools/validate/gst/validate/media-descriptor-writer.c +++ b/subprojects/gst-devtools/validate/gst/validate/media-descriptor-writer.c @@ -735,17 +735,25 @@ gst_validate_media_descriptor_writer_new_discover (GstValidateRunner * runner, gst_validate_media_descriptor_writer_add_stream (writer, streaminfo); } } else { + GstDiscovererStreamInfo *nextinfo; if (!GST_IS_DISCOVERER_AUDIO_INFO (info) - && !GST_IS_DISCOVERER_AUDIO_INFO (info) - && gst_discoverer_stream_info_get_next (streaminfo)) { - gst_validate_media_descriptor_get_file_node ((GstValidateMediaDescriptor - *) writer)->caps = - gst_discoverer_stream_info_get_caps (streaminfo); - streaminfo = gst_discoverer_stream_info_get_next (streaminfo); + && !GST_IS_DISCOVERER_VIDEO_INFO (info)) { + nextinfo = gst_discoverer_stream_info_get_next (streaminfo); + if (nextinfo) { + GstValidateMediaFileNode *fn = + gst_validate_media_descriptor_get_file_node ( + (GstValidateMediaDescriptor *) writer); + fn->caps = gst_discoverer_stream_info_get_caps (streaminfo); + gst_discoverer_stream_info_unref (streaminfo); + streaminfo = nextinfo; + } } do { gst_validate_media_descriptor_writer_add_stream (writer, streaminfo); - } while ((streaminfo = gst_discoverer_stream_info_get_next (streaminfo))); + nextinfo = gst_discoverer_stream_info_get_next (streaminfo); + gst_discoverer_stream_info_unref (streaminfo); + streaminfo = nextinfo; + } while (streaminfo); } } else { GST_VALIDATE_REPORT (writer, FILE_NO_STREAM_INFO,