[FFmpeg-devel] [PATCH] avformat/matroskaenc: Check alpha_mode

Michael Niedermayer michaelni at gmx.at
Wed Aug 20 18:47:02 CEST 2014


Fixes CID1231992

Suggested-by: Timothy Gu <timothygu99 at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavformat/matroskaenc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 7123ec6..98fe4af 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -874,8 +874,8 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
             }
         }
 
-        if ((tag = av_dict_get(st->metadata, "alpha_mode", NULL, 0)) ||
-            (tag = av_dict_get( s->metadata, "alpha_mode", NULL, 0)) ||
+        if (((tag = av_dict_get(st->metadata, "alpha_mode", NULL, 0)) && atoi(tag->value)) ||
+            ((tag = av_dict_get( s->metadata, "alpha_mode", NULL, 0)) && atoi(tag->value)) ||
             (codec->pix_fmt == AV_PIX_FMT_YUVA420P)) {
             put_ebml_uint(pb, MATROSKA_ID_VIDEOALPHAMODE, 1);
         }
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list