[vlc-devel] commit: FIx potential segfault (CID 168) ( Rémi Duraffort )

git version control git at videolan.org
Fri Oct 10 23:17:45 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Oct 10 23:06:09 2008 +0200| [a5ad91e7fc1d2050ba0ced5283af9ebb80155e81] | committer: Rémi Duraffort 

FIx potential segfault (CID 168)

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

 modules/misc/osd/simple.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/misc/osd/simple.c b/modules/misc/osd/simple.c
index f17ebaf..d618da1 100644
--- a/modules/misc/osd/simple.c
+++ b/modules/misc/osd/simple.c
@@ -118,7 +118,7 @@ int osd_parser_simpleOpen( vlc_object_t *p_this )
         /* Peek for 'style' argument */
         pos = ftell( fd );
         if( pos < 0 )
-                goto error;
+            goto error;
 
         result = fscanf(fd, "%24s %24s", &cmd[0], &action[0] );
         if( result == 0 || result == EOF )
@@ -510,7 +510,8 @@ int osd_parser_simpleOpen( vlc_object_t *p_this )
 
 error:
     msg_Err( p_menu, "parsing file failed (returned %d)", result );
-    osd_MenuFree( p_menu );
+    if( p_menu )
+        osd_MenuFree( p_menu );
     fclose( fd );
     return VLC_EGENERIC;
 }




More information about the vlc-devel mailing list