[vlc-commits] libvlc: fix libvlc_media_player_get_fps leak
Thomas Guillem
git at videolan.org
Tue May 31 16:23:36 CEST 2016
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue May 31 12:02:16 2016 +0200| [a968323afaad6bed4b834de4bf0d052c531414ef] | committer: Thomas Guillem
libvlc: fix libvlc_media_player_get_fps leak
And fix a possible use of a released media.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a968323afaad6bed4b834de4bf0d052c531414ef
---
lib/media_player.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/media_player.c b/lib/media_player.c
index a2be453..e56f63f 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -1653,7 +1653,7 @@ float libvlc_media_player_get_fps( libvlc_media_player_t *p_mi )
if( media == NULL )
return 0.f;
- input_item_t *item = p_mi->p_md->p_input_item;
+ input_item_t *item = media->p_input_item;
float fps = 0.f;
vlc_mutex_lock( &item->lock );
@@ -1666,6 +1666,7 @@ float libvlc_media_player_get_fps( libvlc_media_player_t *p_mi )
/ (float)fmt->video.i_frame_rate_base;
}
vlc_mutex_unlock( &item->lock );
+ libvlc_media_release( media );
return fps;
}
More information about the vlc-commits
mailing list