[vlc-devel] commit: Removed dead code + added a check against allocation errors. ( Laurent Aimar )

git version control git at videolan.org
Fri Jul 25 23:32:04 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Jul 25 22:28:43 2008 +0200| [053b0208a015e79df412b4dcdd08fe0b58e291d1]

Removed dead code + added a check against allocation errors.

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

 modules/packetizer/h264.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules/packetizer/h264.c b/modules/packetizer/h264.c
index eeb8d80..6681a42 100644
--- a/modules/packetizer/h264.c
+++ b/modules/packetizer/h264.c
@@ -232,8 +232,6 @@ static int Open( vlc_object_t *p_this )
             block_t *p_sps = nal_get_annexeb( p_dec, p, i_length );
             if( !p_sps )
                 return VLC_EGENERIC;
-            p_sys->p_sps = block_Duplicate( p_sps );
-            p_sps->i_pts = p_sps->i_dts = mdate();
             ParseNALBlock( p_dec, p_sps );
             p += i_length;
         }
@@ -250,14 +248,15 @@ static int Open( vlc_object_t *p_this )
             block_t *p_pps = nal_get_annexeb( p_dec, p, i_length );
             if( !p_pps )
                 return VLC_EGENERIC;
-            p_sys->p_pps = block_Duplicate( p_pps );
-            p_pps->i_pts = p_pps->i_dts = mdate();
             ParseNALBlock( p_dec, p_pps );
             p += i_length;
         }
         msg_Dbg( p_dec, "avcC length size=%d, sps=%d, pps=%d",
                  p_sys->i_avcC_length_size, i_sps, i_pps );
 
+        if( !p_sys->p_sps || p_sys->p_pps )
+            return VLC_EGENERIC;
+
         /* FIXME: FFMPEG isn't happy at all if you leave this */
         if( p_dec->fmt_out.i_extra > 0 ) free( p_dec->fmt_out.p_extra );
         p_dec->fmt_out.i_extra = 0;




More information about the vlc-devel mailing list