comparison mp3.c @ 2795:f417ee08f8c1 libavformat

prevent O(n^2) execution of ff_mpa_decode_header() for valid mp3 files
author michael
date Mon, 03 Dec 2007 04:49:01 +0000
parents d52c718e83f9
children 5002462418f7
comparison
equal deleted inserted replaced
2794:b556182542cb 2795:f417ee08f8c1
416 buf2 += fsize; 416 buf2 += fsize;
417 } 417 }
418 max_frames = FFMAX(max_frames, frames); 418 max_frames = FFMAX(max_frames, frames);
419 if(buf == p->buf) 419 if(buf == p->buf)
420 first_frames= frames; 420 first_frames= frames;
421 if(buf2 > end)
422 break;
421 } 423 }
422 if (first_frames>=3) return AVPROBE_SCORE_MAX/2+1; 424 if (first_frames>=3) return AVPROBE_SCORE_MAX/2+1;
423 else if(max_frames>=3) return AVPROBE_SCORE_MAX/4; 425 else if(max_frames>=3) return AVPROBE_SCORE_MAX/4;
424 else if(max_frames>=1) return 1; 426 else if(max_frames>=1) return 1;
425 else return 0; 427 else return 0;