[vlc-devel] [PATCH] packetizer:mpeg4video: no need to release and realloc the fmt_out extra

Steve Lhomme robux4 at videolabs.io
Wed Jul 19 15:29:57 CEST 2017


It's already copied in the es_format_Copy() above.
---
 modules/packetizer/mpeg4video.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/modules/packetizer/mpeg4video.c b/modules/packetizer/mpeg4video.c
index 6932660c30..1c33a3d02f 100644
--- a/modules/packetizer/mpeg4video.c
+++ b/modules/packetizer/mpeg4video.c
@@ -157,26 +157,13 @@ static int Open( vlc_object_t *p_this )
     es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
     p_dec->fmt_out.i_codec = VLC_CODEC_MP4V;
 
-    free(p_dec->fmt_out.p_extra);
-
-    if( p_dec->fmt_in.i_extra )
+    if( p_dec->fmt_out.i_extra )
     {
         /* We have a vol */
-        p_dec->fmt_out.i_extra = p_dec->fmt_in.i_extra;
-        p_dec->fmt_out.p_extra = xmalloc( p_dec->fmt_in.i_extra );
-        memcpy( p_dec->fmt_out.p_extra, p_dec->fmt_in.p_extra,
-                p_dec->fmt_in.i_extra );
-
-        msg_Dbg( p_dec, "opening with vol size: %d", p_dec->fmt_in.i_extra );
+        msg_Dbg( p_dec, "opening with vol size: %d", p_dec->fmt_out.i_extra );
         ParseVOL( p_dec, &p_dec->fmt_out,
                   p_dec->fmt_out.p_extra, p_dec->fmt_out.i_extra );
     }
-    else
-    {
-        /* No vol, we'll have to look for one later on */
-        p_dec->fmt_out.i_extra = 0;
-        p_dec->fmt_out.p_extra = 0;
-    }
 
     /* Set callback */
     p_dec->pf_packetize = Packetize;
-- 
2.12.1



More information about the vlc-devel mailing list