comparison utils.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 2163852713c5
children 0d9b233dff9b
comparison
equal deleted inserted replaced
2000:ce51095f383b 2001:1a3c9056982a
427 } 427 }
428 428
429 for(probe_size= PROBE_BUF_MIN; probe_size<=PROBE_BUF_MAX && !fmt; probe_size<<=1){ 429 for(probe_size= PROBE_BUF_MIN; probe_size<=PROBE_BUF_MAX && !fmt; probe_size<<=1){
430 int score= probe_size < PROBE_BUF_MAX ? AVPROBE_SCORE_MAX/4 : 0; 430 int score= probe_size < PROBE_BUF_MAX ? AVPROBE_SCORE_MAX/4 : 0;
431 /* read probe data */ 431 /* read probe data */
432 pd->buf= av_realloc(pd->buf, probe_size); 432 pd->buf= av_realloc(pd->buf, probe_size + AVPROBE_PADDING_SIZE);
433 pd->buf_size = get_buffer(pb, pd->buf, probe_size); 433 pd->buf_size = get_buffer(pb, pd->buf, probe_size);
434 if (url_fseek(pb, 0, SEEK_SET) < 0) { 434 if (url_fseek(pb, 0, SEEK_SET) < 0) {
435 url_fclose(pb); 435 url_fclose(pb);
436 if (url_fopen(pb, filename, URL_RDONLY) < 0) { 436 if (url_fopen(pb, filename, URL_RDONLY) < 0) {
437 file_opened = 0; 437 file_opened = 0;