]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/genh.c
avformat/genh: Fix tools/probetest failure
[ffmpeg] / libavformat / genh.c
index 260e32064fa28f398596949e2cce4d407cd1eeab..d8723d51a3a0deb435c303b42af5d0ba0c64f686 100644 (file)
@@ -32,6 +32,8 @@ static int genh_probe(AVProbeData *p)
 {
     if (AV_RL32(p->buf) != MKTAG('G','E','N','H'))
         return 0;
+    if (AV_RL32(p->buf+4) <= 0 || AV_RL32(p->buf+4) > 0xFFFF) // channels
+        return 0;
 
     return AVPROBE_SCORE_MAX / 3 * 2;
 }