]> git.sesse.net Git - vlc/commitdiff
Fix regression introduced in [24381]
authorJean-Paul Saman <jpsaman@videolan.org>
Fri, 18 Jan 2008 10:12:02 +0000 (10:12 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Fri, 18 Jan 2008 10:12:02 +0000 (10:12 +0000)
modules/packetizer/h264.c

index 446f1a12eeb57386d6a61ace064d3f39e63785da..31cef6cff98c2151e89fc2ea4c8fa152c4783775 100644 (file)
@@ -247,14 +247,16 @@ static int Open( vlc_object_t *p_this )
         p_dec->fmt_out.i_extra = 0; p_dec->fmt_out.p_extra = NULL;
 
         /* Set the new extradata */
+        p_dec->fmt_out.i_extra = p_sys->p_pps->i_buffer + p_sys->p_sps->i_buffer;
         p_dec->fmt_out.p_extra = (uint8_t*)malloc( p_dec->fmt_out.i_extra );
         if( p_dec->fmt_out.p_extra )
         {
-            p_dec->fmt_out.i_extra = p_sys->p_pps->i_buffer + p_sys->p_sps->i_buffer;
             memcpy( (uint8_t*)p_dec->fmt_out.p_extra, p_sys->p_sps->p_buffer, p_sys->p_sps->i_buffer);
             memcpy( (uint8_t*)p_dec->fmt_out.p_extra+p_sys->p_sps->i_buffer, p_sys->p_pps->p_buffer, p_sys->p_pps->i_buffer);
             p_sys->b_header = VLC_TRUE;
         }
+        else p_dec->fmt_out.i_extra = 0;
+
         /* Set callback */
         p_dec->pf_packetize = PacketizeAVC1;
     }
@@ -485,10 +487,10 @@ static void nal_get_decoded( uint8_t **pp_ret, int *pi_ret,
     uint8_t *end = &src[i_src];
     uint8_t *dst = malloc( i_src );
 
+    *pp_ret = dst;
+
     if( dst )
     {
-        *pp_ret = dst;
-
         while( src < end )
         {
             if( src < end - 3 && src[0] == 0x00 && src[1] == 0x00 &&