diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 59016cab9fed1a980f1fc3d15d3ca449b3853db5..368c3515641a11416f6f78eebb794b6fd5a8d8e0 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -560,6 +560,7 @@ static int mkv_write_tracks(AVFormatContext *s)
         else
             put_ebml_string(pb, MATROSKA_ID_TRACKLANGUAGE, "und");
 
+        if (st->disposition)
         put_ebml_uint(pb, MATROSKA_ID_TRACKFLAGDEFAULT, !!(st->disposition & AV_DISPOSITION_DEFAULT));
 
         // look for a codec ID string specific to mkv to use,