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

Steve Lhomme git at videolan.org
Fri Jul 21 13:26:01 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Wed Jul 19 13:02:25 2017 +0200| [ea0150304c0b166e118c7562326456db45778f7c] | committer: Jean-Baptiste Kempf

packetizer:mpeg4video: no need to release and realloc the fmt_out extra

It's already copied in the es_format_Copy() above.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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;



More information about the vlc-commits mailing list