[vlc-devel] commit: libvlc_video_get_height: Don't use a potentially freed pointer. ( Pierre d'Herbemont )

git version control git at videolan.org
Fri Jun 13 15:36:19 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Fri Jun 13 15:36:44 2008 +0200| [3e2015d830378f0e47b9a03c99608df7e7628486]

libvlc_video_get_height: Don't use a potentially freed pointer.

Pointed-out-by: Lukas

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3e2015d830378f0e47b9a03c99608df7e7628486
---

 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 f0ff7e0..9e0e263 100644
--- a/src/control/video.c
+++ b/src/control/video.c
@@ -139,13 +139,16 @@ libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, char *psz_filepath,
 int libvlc_video_get_height( libvlc_media_player_t *p_mi,
                              libvlc_exception_t *p_e )
 {
+    int height;
+
     vout_thread_t *p_vout = GetVout( p_mi, p_e );
-    if( !p_vout )
-        return 0;
+    if( !p_vout ) return 0;
+
+    height = p_vout->i_window_height;
 
     vlc_object_release( p_vout );
 
-    return p_vout->i_window_height;
+    return height;
 }
 
 int libvlc_video_get_width( libvlc_media_player_t *p_mi,




More information about the vlc-devel mailing list