mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 03:31:05 +00:00
validate: Don't leak discoverer information
The various streaminfo were being overwritten without being unreffed first Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3390>
This commit is contained in:
parent
00133ebbe4
commit
3f95779c30
1 changed files with 15 additions and 7 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue