avformat/matroskaenc: Check alpha_mode
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 20 Aug 2014 16:40:20 +0000 (18:40 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 24 Aug 2014 18:33:17 +0000 (20:33 +0200)
Fixes CID1231992

Suggested-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/matroskaenc.c

index 7123ec6..98fe4af 100644 (file)
@@ -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);
         }