Mercurial > libavformat.hg
comparison raw.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 | f73b9a471583 |
children | d54b738a5bfa |
comparison
equal
deleted
inserted
replaced
2000:ce51095f383b | 2001:1a3c9056982a |
---|---|
380 static int h263_probe(AVProbeData *p) | 380 static int h263_probe(AVProbeData *p) |
381 { | 381 { |
382 int code; | 382 int code; |
383 const uint8_t *d; | 383 const uint8_t *d; |
384 | 384 |
385 if (p->buf_size < 6) | |
386 return 0; | |
387 d = p->buf; | 385 d = p->buf; |
388 code = (d[0] << 14) | (d[1] << 6) | (d[2] >> 2); | 386 code = (d[0] << 14) | (d[1] << 6) | (d[2] >> 2); |
389 if (code == 0x20) { | 387 if (code == 0x20) { |
390 return 50; | 388 return 50; |
391 } | 389 } |
395 static int h261_probe(AVProbeData *p) | 393 static int h261_probe(AVProbeData *p) |
396 { | 394 { |
397 int code; | 395 int code; |
398 const uint8_t *d; | 396 const uint8_t *d; |
399 | 397 |
400 if (p->buf_size < 6) | |
401 return 0; | |
402 d = p->buf; | 398 d = p->buf; |
403 code = (d[0] << 12) | (d[1] << 4) | (d[2] >> 4); | 399 code = (d[0] << 12) | (d[1] << 4) | (d[2] >> 4); |
404 if (code == 0x10) { | 400 if (code == 0x10) { |
405 return 50; | 401 return 50; |
406 } | 402 } |