[vlc-commits] mft: use video_format_Copy() instead of plain structure copy

Steve Lhomme git at videolan.org
Wed Jul 12 12:22:22 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Mon Jul 10 16:15:55 2017 +0200| [c3af9ac279cf7c29d07516009750e69b8be9c184] | committer: Jean-Baptiste Kempf

mft: use video_format_Copy() instead of plain structure copy

If there is a palette we don't want to use the same pointer otherwise there
will be a double free.

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

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

 modules/codec/mft.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/codec/mft.c b/modules/codec/mft.c
index 8fc6ff532b..c0412cf38e 100644
--- a/modules/codec/mft.c
+++ b/modules/codec/mft.c
@@ -418,7 +418,7 @@ static int SetOutputType(decoder_t *p_dec, DWORD stream_id, IMFMediaType **resul
 
     if (p_dec->fmt_in.i_cat == VIDEO_ES)
     {
-        p_dec->fmt_out.video = p_dec->fmt_in.video;
+        video_format_Copy( &p_dec->fmt_out.video, &p_dec->fmt_in.video );
         p_dec->fmt_out.i_codec = vlc_fourcc_GetCodec(p_dec->fmt_in.i_cat, subtype.Data1);
     }
     else



More information about the vlc-commits mailing list