comparison mpeg.c @ 2001:1a3c9056982a libavformat

allocate 32 extra bytes at the end of the probe buffer and remove most probe buf_size checks
author michael
date Sun, 08 Apr 2007 11:34:15 +0000
parents eb16c64144ee
children a3e79d6e4e3c
comparison
equal deleted inserted replaced
2000:ce51095f383b 2001:1a3c9056982a
1258 #define MAX_SYNC_SIZE 100000 1258 #define MAX_SYNC_SIZE 100000
1259 1259
1260 static int cdxa_probe(AVProbeData *p) 1260 static int cdxa_probe(AVProbeData *p)
1261 { 1261 {
1262 /* check file header */ 1262 /* check file header */
1263 if (p->buf_size <= 32)
1264 return 0;
1265 if (p->buf[0] == 'R' && p->buf[1] == 'I' && 1263 if (p->buf[0] == 'R' && p->buf[1] == 'I' &&
1266 p->buf[2] == 'F' && p->buf[3] == 'F' && 1264 p->buf[2] == 'F' && p->buf[3] == 'F' &&
1267 p->buf[8] == 'C' && p->buf[9] == 'D' && 1265 p->buf[8] == 'C' && p->buf[9] == 'D' &&
1268 p->buf[10] == 'X' && p->buf[11] == 'A') 1266 p->buf[10] == 'X' && p->buf[11] == 'A')
1269 return AVPROBE_SCORE_MAX; 1267 return AVPROBE_SCORE_MAX;