]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/yop.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavformat / yop.c
index e8f4e8e6ab825bf43dabe235590b2a25ae2f7709..7fd28af0e2009c89a4501f6ea321aeb31f289ed7 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;
@@ -206,7 +211,7 @@ static int yop_read_seek(AVFormatContext *s, int stream_index,
 
 AVInputFormat ff_yop_demuxer = {
     .name           = "yop",
-    .long_name      = NULL_IF_CONFIG_SMALL("Psygnosis YOP Format"),
+    .long_name      = NULL_IF_CONFIG_SMALL("Psygnosis YOP"),
     .priv_data_size = sizeof(YopDecContext),
     .read_probe     = yop_probe,
     .read_header    = yop_read_header,