]> git.sesse.net Git - vlc/commitdiff
Fix potential segfault (CID 158)
authorRémi Duraffort <ivoire@videolan.org>
Fri, 10 Oct 2008 20:54:45 +0000 (22:54 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Fri, 10 Oct 2008 20:54:45 +0000 (22:54 +0200)
modules/codec/dvbsub.c

index d277f4f7beab531292ebedf9b4df584a257df37e..9658c89512f6a2048771545ab4cdce1a2f96208f 100644 (file)
@@ -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 */