[vlc-devel] commit: libvlc_video_get_width: Don't use a potentially freed pointer. ( Pierre d'Herbemont )
git version control
git at videolan.org
Fri Jun 13 15:37:57 CEST 2008
vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Fri Jun 13 15:38:23 2008 +0200| [d7f46e85fb1bbe570dc617458529f71552005bcd]
libvlc_video_get_width: Don't use a potentially freed pointer.
Pointed-out-by: Lukas
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d7f46e85fb1bbe570dc617458529f71552005bcd
---
src/control/video.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/control/video.c b/src/control/video.c
index 9e0e263..f243333 100644
--- a/src/control/video.c
+++ b/src/control/video.c
@@ -154,13 +154,16 @@ int libvlc_video_get_height( libvlc_media_player_t *p_mi,
int libvlc_video_get_width( libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
{
+ int width;
+
vout_thread_t *p_vout = GetVout( p_mi, p_e );
- if( !p_vout )
- return 0;
+ if( !p_vout ) return 0;
+
+ width = p_vout->i_window_width;
vlc_object_release( p_vout );
- return p_vout->i_window_width;
+ return width;
}
int libvlc_media_player_has_vout( libvlc_media_player_t *p_mi,
More information about the vlc-devel
mailing list