comparison tiertexseq.c @ 1618:7376514d9d60 libavformat

missdetected a broken mp3
author michael
date Tue, 02 Jan 2007 22:22:12 +0000
parents c7d4c4279fb7
children 2f0154760e5f
comparison
equal deleted inserted replaced
1617:ad71e733bc20 1618:7376514d9d60
60 60
61 static int seq_probe(AVProbeData *p) 61 static int seq_probe(AVProbeData *p)
62 { 62 {
63 int i; 63 int i;
64 64
65 if (p->buf_size < 256) 65 if (p->buf_size < 258)
66 return 0; 66 return 0;
67 67
68 /* there's no real header in a .seq file, the only thing they have in common */ 68 /* there's no real header in a .seq file, the only thing they have in common */
69 /* is the first 256 bytes of the file which are always filled with 0 */ 69 /* is the first 256 bytes of the file which are always filled with 0 */
70 for (i = 0; i < 256; i++) 70 for (i = 0; i < 256; i++)
71 if (p->buf[i] != 0) 71 if (p->buf[i] != 0)
72 return 0; 72 return 0;
73
74 if(p->buf[256]==0 && p->buf[257]==0)
75 return 0;
73 76
74 /* only one fourth of the score since the previous check is too naive */ 77 /* only one fourth of the score since the previous check is too naive */
75 return AVPROBE_SCORE_MAX / 4; 78 return AVPROBE_SCORE_MAX / 4;
76 } 79 }
77 80