]> git.sesse.net Git - vlc/commitdiff
libvlc_video_get_height: Don't use a potentially freed pointer.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 13 Jun 2008 13:36:44 +0000 (15:36 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Fri, 13 Jun 2008 13:36:44 +0000 (15:36 +0200)
Pointed-out-by: Lukas
src/control/video.c

index f0ff7e0b809b5b867bd6ef3f94d42841ad6565e8..9e0e2630603c87ed37cd1581f57e6fd8179f733c 100644 (file)
@@ -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,