]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/yop.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavformat / yop.c
index d1c24fb2fa76a895acd93e4908d26d2ee1b7b4ec..c7d3f651925a80a1072e757441e255a1b1d77dab 100644 (file)
@@ -38,10 +38,15 @@ typedef struct yop_dec_context {
 static int yop_probe(AVProbeData *probe_packet)
 {
     if (AV_RB16(probe_packet->buf) == AV_RB16("YO")  &&
+        probe_packet->buf[2]<10                      &&
+        probe_packet->buf[3]<10                      &&
         probe_packet->buf[6]                         &&
         probe_packet->buf[7]                         &&
         !(probe_packet->buf[8] & 1)                  &&
-        !(probe_packet->buf[10] & 1))
+        !(probe_packet->buf[10] & 1)                 &&
+        AV_RL16(probe_packet->buf + 12 + 6) >= 920    &&
+        AV_RL16(probe_packet->buf + 12 + 6) < probe_packet->buf[12] * 3 + 4 + probe_packet->buf[7] * 2048
+    )
         return AVPROBE_SCORE_MAX * 3 / 4;
 
     return 0;
@@ -213,6 +218,6 @@ AVInputFormat ff_yop_demuxer = {
     .read_packet    = yop_read_packet,
     .read_close     = yop_read_close,
     .read_seek      = yop_read_seek,
-    .extensions = "yop",
-    .flags = AVFMT_GENERIC_INDEX,
+    .extensions     = "yop",
+    .flags          = AVFMT_GENERIC_INDEX,
 };