[vlc-devel] [PATCH 05/25] mft: use video_format_Copy() instead of plain structure copy

Steve Lhomme robux4 at videolabs.io
Mon Jul 10 16:52:09 CEST 2017


If there is a palette we don't want to use the same pointer otherwise there
will be a double free.
---
 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
-- 
2.12.1



More information about the vlc-devel mailing list