allocate 32 extra bytes at the end of the probe buffer and remove most probe buf_size checks

Originally committed as revision 8677 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer
2007-04-08 11:34:15 +00:00
parent f118d254be
commit 87e8788680
45 changed files with 7 additions and 104 deletions

View File

@@ -429,7 +429,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
for(probe_size= PROBE_BUF_MIN; probe_size<=PROBE_BUF_MAX && !fmt; probe_size<<=1){
int score= probe_size < PROBE_BUF_MAX ? AVPROBE_SCORE_MAX/4 : 0;
/* read probe data */
pd->buf= av_realloc(pd->buf, probe_size);
pd->buf= av_realloc(pd->buf, probe_size + AVPROBE_PADDING_SIZE);
pd->buf_size = get_buffer(pb, pd->buf, probe_size);
if (url_fseek(pb, 0, SEEK_SET) < 0) {
url_fclose(pb);