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

git version control git at videolan.org
Fri Oct 10 23:20:31 CEST 2008


vlc | branch: 0.9-bugfix | Rémi Duraffort <ivoire at videolan.org> | Fri Oct 10 22:54:45 2008 +0200| [767b81f8d9b89148d95e5f508adf24ea0f54d800] | committer: Derk-Jan Hartman 

Fix potential segfault (CID 158)
(cherry picked from commit 29a15bf072ff5743dc294edf406452512b23675d)

Signed-off-by: Derk-Jan Hartman <hartman at videolan.org>

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

 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 57dadf3..d4708dc 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