1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Fix ticket127

This fixes detectiion of slightly too big dummy frames.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-05-22 19:06:10 +02:00
parent 94ea17075b
commit a0cd98b594

View File

@ -681,22 +681,18 @@ retry:
frame_end:
/* divx 5.01+ bistream reorder stuff */
if(s->codec_id==CODEC_ID_MPEG4 && s->divx_packed){
int current_pos= get_bits_count(&s->gb)>>3;
int current_pos= s->gb.buffer == s->bitstream_buffer ? 0 : (get_bits_count(&s->gb)>>3);
int startcode_found=0;
if(buf_size - current_pos > 5){
int i;
for(i=current_pos; i<buf_size-3; i++){
for(i=current_pos; i<buf_size-4; i++){
if(buf[i]==0 && buf[i+1]==0 && buf[i+2]==1 && buf[i+3]==0xB6){
startcode_found=1;
startcode_found=!(buf[i+4]&0x40);
break;
}
}
}
if(s->gb.buffer == s->bitstream_buffer && buf_size>7 && s->xvid_build>=0){ //xvid style
startcode_found=1;
current_pos=0;
}
if(startcode_found){
av_fast_malloc(