diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 3a8e76e51ce2d5dd1682ec87b88dce70f20db721..996969d1ff47f369f46d7914f4f48308bb1d1a1e 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -423,7 +423,7 @@ static int mxf_get_stream_index(AVFormatContext *s, KLVPacket *klv, int body_sid
             return i;
     }
     /* return 0 if only one stream, for OP Atom files with 0 as track number */
-    return s->nb_streams == 1 ? 0 : -1;
+    return s->nb_streams == 1 && s->streams[0]->priv_data ? 0 : -1;
 }
 
 static int find_body_sid_by_offset(MXFContext *mxf, int64_t offset)