[vlc-devel] commit: Fix potential segfault (CID 158) ( 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 22:54:45 2008 +0200| [29a15bf072ff5743dc294edf406452512b23675d] | committer: Rémi Duraffort 

Fix potential segfault (CID 158)

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

 modules/codec/dvbsub.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/modules/codec/dvbsub.c b/modules/codec/dvbsub.c
index d277f4f..9658c89 100644
--- a/modules/codec/dvbsub.c
+++ b/modules/codec/dvbsub.c
@@ -838,13 +838,12 @@ static void decode_region_composition( decoder_t *p_dec, bs_t *s )
         msg_Dbg( p_dec, "new region: %i", i_id );
 #endif
         p_region = *pp_region = malloc( sizeof(dvbsub_region_t) );
-        if( p_region )
-        {
-            memset( p_region, 0, sizeof(dvbsub_region_t) );
-            p_region->p_object_defs = NULL;
-            p_region->p_pixbuf = NULL;
-            p_region->p_next = NULL;
-        }
+        if( !p_region )
+            return;
+        memset( p_region, 0, sizeof(dvbsub_region_t) );
+        p_region->p_object_defs = NULL;
+        p_region->p_pixbuf = NULL;
+        p_region->p_next = NULL;
     }
 
     /* Region attributes */




More information about the vlc-devel mailing list